View comments | RSS feed

GetTickCount

Description

Determines the differences between the results of GetTickCount at successive points of page processing.

Return value

An integer value

Category

Date and time functions

Syntax

GetTickCount()

Usage

This function is useful for timing CFML code segments or other page processing elements.

Example

<!--- 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>

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6

Comments are no longer accepted for ColdFusion MX. ColdFusion 8 is the current version.

Comments


Bjorno said on Dec 19, 2003 at 11:34 AM :
What is the internal timer based on? Does it reset when the server reboots?
jrunrandy said on Dec 30, 2003 at 1:07 PM :
getTickCount is based on the Java method System.currentTimeMillis()

However, this value can vary, based on platform and OS and it's probably not a good idea to make anything depend on this value. In addition, CFMX returns this value as an int and CFMX 6.1 returns it as a String.

Also, the description on the CFMX page isn't great. See the 6.1 page for a better description: http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/funct110.htm

See the JavaDocs for more information: http://java.sun.com/j2se/1.4.1/docs/api/
halL said on Mar 5, 2008 at 2:13 PM :
For a better description of this function, see the ColdFusion 8 version of this page, at http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=unctions_e-g_64.html

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt1110.htm