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();

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


Tag version

<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.


Script version

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..


Fork me on GitHub