August 2001
Intermediate to advanced
976 pages
38h 8m
English
GetTickCount
GetTickCount( )
Returns a counter in milliseconds. GetTickCount( )
is useful for reporting the amount of time it takes to process
specific parts of CFML code. The following example counts the time
(in milliseconds) it takes to process a loop with 10,000 iterations:
<CFSET Start = GetTickCount( )> <CFOUTPUT><B>Start TickCount:</B> #Start#</CFOUTPUT> <P>Looping from 1 to 10000 <CFSET Timer="0"> <CFLOOP INDEX="counter" FROM="1" TO="10000"> <CFSET Timer=Timer+1> </CFLOOP> <CFSET End = GetTickCount( )> <P> <CFOUTPUT><B>End TickCount:</B> #End#</CFOUTPUT> <CFSET TotalTime = (Evaluate(End - Start))> <P> <CFOUTPUT><B>Total processing time:</B> #TotalTime# milliseconds</CFOUTPUT>
Read now
Unlock full access