GetTickCount

Description

Returns a millisecond clock counter that can be used for timing sections of CFML code or other aspects of page processing.

Category

Date and time functions

Syntax


GetTickCount() 

Usage

Generate useful timing values by taking differences between the results of GetTickCount() at successive points of page processing.

Example

<!--- This example calls GetTickCount to track execution time --->

<html>

<body>

<!--- Setup timing test --->

<cfset iterationCount = 1000>



<!--- Time an empty loop with this many iterations --->

<cfset tickBegin = GetTickCount()>

<CFLOOP Index = i From = 1 To = #iterationCount#></CFLOOP>

<cfset tickEnd = GetTickCount()>

<cfset loopTime = tickEnd - tickBegin>



<!--- Report --->

<cfoutput>Loop time (#iterationCount# iterations) was: #loopTime#

 milliseconds</cfoutput>



</body>

</html>



Banner.Novgorod.Ru