pf » CFTIMER - Little things in ColdFusion 7
CFTIMER - Little things in ColdFusion 7
I am digging the new cftimer tag in ColdFusion MX 7.
In previous versions when you want to time how long something takes, you would do something like this:
<cfset tick = GetTickCount()> run your code here... <cfset tock = GetTickCount()> <cfset time = tock-tick> <cfoutput>it took #time#ms</cfoutput>
With the new cftimer you just need to wrap your code with the CFTIMER tag (and turn on the display Timer Information option in ColdFusion Administrator)
<cftimer label="Google Download Timer" type="outline"> <cfhttp method="get" url="http://www.google.com/"></cfhttp> <cfoutput>downloaded google</cfoutput> </cftimer>
And it will output something like this:
Note that your browser must support the fieldset and legend tags for this to show up properly with cftimer type="outline"
There are other output types you can use: inline which just displays the timer at the position of the </cftimer> tag, the comment type inserts the timer in an HTML comment, eg: <!-- Google Download Timer: 62ms -->, and the debug type displays the timers at the bottom of the page with the debug output.
Related Entries
- CFFUNCTION and CFARGUMENT don't support new types in ColdFusion 7 - April 13, 2005
- Hash - March 15, 2005
- Strong Encryption Technote shows undocumented features - February 22, 2005
- cfdirectory adds recursive support - Little Things in CFMX 7 - February 10, 2005
- IsValid - CFMX 7 Little Things - February 10, 2005
- CFSCRIPT Cheatsheet
- 3 New Image Effects for ColdFusion 8
- Googlebot to Submit Web Forms
- ColdFusion 8 Update 1 Fixes some Image Processing Quirks
- 10 Most Useful Image Functions in ColdFusion 8
- Speaking at NYC CFUG This Week
- Adobe AIR Tutorial for HTML / JavaScript Developers
- INFORMATION_SCHEMA Support in MySQL, PostgreSQL
RSS
add to del.icio.us
Pete Freitag is a software engineer, and web developer located in










