<html>
<head>
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>CFTIMER</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
   <div id="Description">
   <table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
      <tr> 
         <td valign="top" class="name">CFTIMER</td>
         <td valign="top" nowrap class="compatibility">&nbsp;</td>
      </tr>
      <tr>
         <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
      </tr>


    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Description</span>
<p>
Displays execution time for a specified section of CFML code. ColdFusion&#160;MX displays the timing information along with any output produced by the timed code.
</p>
<table>
  <tr valign="top">
    <td width="30"><strong>Note: </strong></td>
    <td>To permit this tag to execute, you must enable the Timer Information option under Debugging Settings in the ColdFusion MX Administrator.</td>
  </tr>
</table>    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Category</span>
<p>
Debugging tags
</p>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="syntax"><span class="title">Syntax</span><pre>&lt;cftimer
   label= &quot;text&quot;
   type = &quot;inline&quot; or &quot;outline&quot; or &quot;comment&quot; or &quot;debug&quot; &gt;

   CFML statement(s)

&lt;/cftimer&gt;
</pre>    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">See also</span>
<p>
cfdump, cftrace; Chapter&#160;18, "Debugging and Troubleshooting Applications" in ColdFusion MX Developer's Guide
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">History</span>
<p>
ColdFusion&#160;MX&#160;7: Added this tag.
</p>

<p>

</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Usage</span>
<p>
Use this tag to determine how long it takes for a block of code to execute. You can nest cftimer tags.
</p>

<p>
This tag is useful for debugging CFML code during application development. In production, you can leave cftimer tags in your code as long as you have disabled the debugging option in the ColdFusion MX Administrator.
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Example</span><pre>...
&lt;!--- type=&quot;inline&quot;&gt; ---&gt;
     &lt;cftimer label=&quot;Query and Loop Time Inline&quot; type=&quot;inline&quot;&gt;
      &lt;cfquery name=&quot;empquery&quot; datasource=&quot;cfdocexamples&quot;&gt;
            select *
            from Employees
      &lt;/cfquery&gt;

      &lt;cfloop query=&quot;empquery&quot;&gt;
        &lt;cfoutput&gt;#lastname#, #firstname#&lt;/cfoutput&gt;&lt;br&gt;
      &lt;/cfloop&gt;
   &lt;/cftimer&gt;
&lt;hr&gt;&lt;br&gt;

&lt;!--- type=&quot;outline&quot; ---&gt;
     &lt;cftimer label=&quot;Query and CFOUTPUT Time with Outline&quot; type=&quot;outline&quot;&gt;
      &lt;cfquery name=&quot;coursequery&quot; datasource=&quot;cfdocexamples&quot;&gt;
            select *
            from CourseList
      &lt;/cfquery&gt;
   &lt;table border=&quot;1&quot; width=&quot;100%&quot;&gt;
      &lt;cfoutput query=&quot;coursequery&quot;&gt;
      &lt;tr&gt;
      &lt;td&gt;#Course_ID#&lt;/td&gt;
      &lt;td&gt;#CorName#&lt;/td&gt;
      &lt;td&gt;#CorLevel#&lt;/td&gt;
      &lt;/tr&gt;
      &lt;/cfoutput&gt;
      &lt;/table&gt;
   &lt;/cftimer&gt;
&lt;hr&gt;&lt;br&gt;

&lt;!--- type=&quot;comment&quot; ---&gt;
     &lt;cftimer label=&quot;Query and CFOUTPUT Time in Comment&quot; type=&quot;comment&quot;&gt;
      &lt;cfquery name=&quot;parkquery&quot; datasource=&quot;cfdocexamples&quot;&gt;
            select *
            from Parks
      &lt;/cfquery&gt;
        &lt;p&gt;Select View &amp;gt; Source to see timing information&lt;/p&gt;
       &lt;table border=&quot;1&quot; width=&quot;100%&quot;&gt;
      &lt;cfoutput query=&quot;parkquery&quot;&gt;
      &lt;tr&gt;
      &lt;td&gt;#Parkname#&lt;/td&gt;
      &lt;/tr&gt;
      &lt;/cfoutput&gt;
      &lt;/table&gt;
   &lt;/cftimer&gt;
&lt;hr&gt;&lt;br&gt;

&lt;!--- type=&quot;debug&quot; ---&gt;
     &lt;cftimer label=&quot;Query and CFOUTPUT Time in Debug Output&quot; type=&quot;debug&quot;&gt;
      &lt;cfquery name=&quot;deptquery&quot; datasource=&quot;cfdocexamples&quot;&gt;
            select *
            from Departments
      &lt;/cfquery&gt;
        &lt;p&gt;Scroll down to CFTimer Times heading to see timing information&lt;/p&gt;
       &lt;table border=&quot;1&quot; width=&quot;100%&quot;&gt;
      &lt;cfoutput query=&quot;deptquery&quot;&gt;
      &lt;tr&gt;
      &lt;td&gt;#Dept_ID#&lt;/td&gt;
      &lt;td&gt;#Dept_Name#&lt;/td&gt;
      &lt;/tr&gt;
      &lt;/cfoutput&gt;
      &lt;/table&gt;
   &lt;/cftimer&gt;
...
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="LABEL">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">LABEL</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">Optional</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">

<strong>Default value:</strong> "&quot; &quot;"


<p>Label to display with timing information.</p>

  </td>
  </tr>
  </table>
</div>
<div id="TYPE">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">TYPE</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">Optional</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">

<strong>Default value:</strong> "debug"

<ul>

<li>inline: displays timing information inline, following the resulting HTML.</li>

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

<li>comment: displays timing information in an HTML comment in the format &lt;!--&#160;label:&#160;elapsed-time&#160;ms&#160;--&gt;. The default label is cftimer.</li>

<li>debug: displays timing information in the debug output under the heading CFTimer Times.</li>
</ul>


  </td>
  </tr>
  </table>
</div>

  </body>
</html>
