Been fiddling with this myself for a while...
What I've found to be effective is to get a count before the proceedure,
perform the block of code, get another after and subtract.

<CFSET start = GetTickCount()>
<CFOUTPUT>
  <CFLOOP from="1" to="10000" index="i" step="1"></CFLOOP>
<CFSET end = GetTickCount()>
<CFSET elapsed = (end - start)>
Time to Execute is #elapsed# miliseconds
</cfoutput>


Jeff Garza
Web Developer
Spectrum Astro, Inc.
480-892-8200

[EMAIL PROTECTED]
http://www.spectrumastro.com



-----Original Message-----
From: Eric Fickes [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 01, 2000 10:26 AM
To: CF-Talk
Subject: GetTicketCount() - where and when


Hello all,

I'm trying to trim some fat off my code, and I came across GetTickCount()
and had a few questions after reading the definition from my CF book.

Definition:
Returns a millisecond clock counter that can be used for timing sections of
CFML code or any other aspects of page processing.

1.This counter is how long it took the CF server to parse the CF code.  EG,
execution time?
2.Is this for the entire page, or just for code contained in between
<CFOUTPUT> and </CFOUTPUT>?

What I'd like to do is compare the execution time of some code and I was
thinking I could do this

<cfoutput>
        <CFCODE 1>
Code1 Time: #GetTicketCount()
</cfoutput>

<cfoutput>
        <CFCODE 2>
Code2 Time: #GetTicketCount()
</cfoutput>

Obviously I'd have to format the returned value, but is this what the
definition is saying?

E
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to