How to get the system time in milliseconds in ColdFusion

GetTickCount() - get the system time in milliseconds

GetTickCount.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>GetTickCount function example: how to get the system time in milliseconds</title>
</head>

<body>
<h2 style="color:hotpink">GetTickCount Function Example</h2>

<cfset StartTick=GetTickCount()>
<cfoutput><b>StartTick: #StartTick#</b></cfoutput>
<br /><br />

Loop start...[1-1000000]
<br />
<cfloop index="i" from="1" to="1000000" step="1">
</cfloop>
Loop end...
<br /><br />

<cfset EndTick=GetTickCount()>
<cfoutput><b>EndTick: #EndTick#</b></cfoutput>
<br /><br />

Loop Time: <cfoutput>#StartTick-EndTick# milliseconds</cfoutput>

</body>
</html>





More ColdFusion examples