User Guide

Table Of Contents
Using the cftimer tag to time blocks of code 441
Calling the cftimer tag
You can control where the
cftimer tag displays timing information, as follows:
Inline Displays timing information following the </cftimer> tag.
Outline Displays timing information at the beginning of the timed code and draws a box
around the timed code. (This requires browser support for the HTML FIELDSET attribute.)
Comment Displays timing information in an HTML comment in the format <!-- label:
elapsed-time ms -->. The default label is cftimer.
Debug Displays timing information in the debugging output under the heading CFTimer
Times.
The following example calls the
cftimer tag multiple times, each time using a different type
attribute:
<HTML>
<body>
<h1>CFTIMER test</h1>
<!--- type="inline" --->
<cftimer label="Query and Loop Time Inline" type="inline">
<cfquery name="empquery" datasource="cfdocexamples">
select *
from Employees
</cfquery>
<cfloop query="empquery">
<cfoutput>#lastname#, #firstname#</cfoutput><br>
</cfloop>
</cftimer>
<hr><br>
<!--- type="outline" --->
<cftimer label="Query and CFOUTPUT Time with Outline" type="outline">
<cfquery name="coursequery" datasource="cfdocexamples">
select *
from CourseList
</cfquery>
<table border="1" width="100%">
<cfoutput query="coursequery">
<tr>
<td>#Course_ID#</td>
<td>#CorName#</td>
<td>#CorLevel#</td>
</tr>
</cfoutput>
</table>
</cftimer>
<hr><br>
<!--- type="comment" --->
<cftimer label="Query and CFOUTPUT Time in Comment" type="comment">
<cfquery name="parkquery" datasource="cfdocexamples">
select *
from Parks
</cfquery>