Adobe COLDFUSION 9 Manual page 395

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Developing CFML Applications
Using timing
Use this tag to determine how long it takes for a block of code to execute. This is useful when ColdFusion debugging
output indicates excessive execution time, but does not pinpoint the long-running block of code.
To use this tag, enable debugging in the ColdFusion Administrator Debugging Settings page. In the Debugging
Settings page, you must also specifically enable usage of the
If you enable debugging for the
generate timing information without disturbing production users.
Calling the cftimer tag
You can control where the
cftimer
• Inline: Displays timing information following the
• 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
default label is
.
cftimer
• Debug: Displays timing information in the debugging output under the heading CFTimer Times.
The following example calls the
<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>
cftimer
tag only and display timing information in an HTML comment, you can
cftimer
tag displays timing information, as follows:
</cftimer>
tag multiple times, each time using a different
cftimer
Last updated 8/5/2010
tag by checking the Timer Information check box.
tag.
elapsed-timems >--. The
:
attribute:
type
390

Advertisement

Table of Contents
loading

Table of Contents