cftimer

Displays execution time for a specified section of
CFML code. ColdFusion MX displays the timing information
along with any output produced by the timed code.

  <cftimer>

 cftimer() {}

Attribute Reference

label string

Label to display with timing information.
Default: " "

type string
Default: debug

- inline: displays timing information inline, following the
resulting HTML.
- outline: displays timing information and also displays a line
around the output produced by the timed code. The browser
must support the FIELDSET tag to display the outline.
- comment: displays timing information in an HTML comment
in the format . The default label
is cftimer.
- debug: displays timing information in the debug output
under the heading CFTimer Times.
Default: debug
Values:
  • inline
  • outline
  • comment
  • debug

Examples
Sample code using the cftimer tag

<cftimer label="Nap time" type="inline">
Begin some long running process ...
<cfset sleep(2000)>
done.
</cftimer>

Expected Result: The time elapsed while executing the code inside the <cftimer> block should be displayed inline.

cftimer(label = "Nap time", type="outline"){
writeoutput("Begin some long running process ... ");
sleep(2000);
writeoutput("done.");
}

Expected Result: The time elapsed while executing the code inside the cftimer block should be displayed in the output with an outline around any output generated within the cftimer call..

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub