<cfstopwatch>

Measures the time taken, in milliseconds, for the code between the start tag and end tag to execute.

This tag must have a body.

This tag is also supported within <cfscript>

<cfstopwatch label=string variable=string ><!--- body ---></cfstopwatch>
Attribute Description
label
string, optional

The label for the stopwatch, used in debugging output.

variable
string, optional

The name of the variable which will contain the value of the time taken.

Examples

Tags

<cfstopwatch variable="stopwatchVar">
    <cfset i = 0>
    <cfloop from="1" to="10000" index="j">
        <cfset i++>
    </cfloop>
</cfstopwatch>

<cfdump var="#stopwatchVar#">

Script

stopwatch variable="stopwatchVar" {
    i = 0;
    loop from="1" to="10000" index="j" {
        i++;
    }
}
dump(stopwatchVar);

See also