Welcome to NuclearPants.com
...different bottle, same great taste!
iconFinder
|
cfQuickDocs
|
Ben Nadel`s Blog
|
ColdFusion Jedi
|
redbox
|
Portable Apps
|
Grooveshark
|
Ken Radio
|
AccuWeather »
|
Weidenhammer
|
WebMail
|
All Recipes
|
The Weather Channel »
ColdFusion (CFML)
|
Coming soon...
<!--- 'Nifty' utility used to measure the time between events...useful for isolating sections of your code that might be slow!!! ---> <cffunction name="clockit"> <cfargument name="label" type="string" required="no" default=""> <cfparam name="request.arrTS" default="#ArrayNew(1)#"> <cfset currentTick = GetTickCount()> <cfset currentIndex = ArrayLen(request.arrTS)+1> <cfset request.arrTS[currentIndex] = currentTick> <!--- If index is not 1, calculate difference... ---> <cfset diff = 0.0> <cfif currentIndex neq 1> <cfset diff = (request.arrTS[currentIndex] - request.arrTS[currentIndex-1])/1000> </cfif> <cfoutput> <cfset strColor = "green"> <cfif diff gt 1.0><!--- 1 SECOND - DETERMINES IF THE TIMELAPSE IS DISPLAYED IN RED OR NOT TO INDICATE CODE THAT TAKES TOO LONG TO EXECUTE ---> <cfset strColor = "red"> </cfif> <div style="font-family:arial; font-size:12px; color:navy;"> #currentIndex#. #arguments.label#: #currentTick# <cfif Len(diff)><span style="color:#strColor#"> Time lapsed: #diff#</span></cfif> </div> </cfoutput> </cffunction> |
© 2003-2012 www.NuclearPants.com - All Rights Reserved
