I tried this code and, on the first try, got an elapsed time of 30 ms.  Subsequent 
fresh loads return 0 ms, and CF's debugging info tells me this:

0 ms C:\INETPUB\WWWROOT\TESTING\APPLICATION.CFM 
0 ms C:\INETPUB\WWWROOT\TESTING\SLEEP.CFM 
30 ms STARTUP, PARSING, & SHUTDOWN 

Changing the Sleep value yields no results.  Its my understanding the CFLOCK timeout 
value is the amount of time the lock will be *attempted* before the lock attempt 
fails, not the amount of time it'll hold.  Am I missing something?  

---------------------------------------
Matt Robertson    [EMAIL PROTECTED]
MSB Designs, Inc., www.mysecretbase.com
---------------------------------------


---------- Original Message ----------------------------------
from: "Rick Osborne [Mojo]" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
date: Mon, 29 Oct 2001 17:08:57 -0500

Brian Ferrigno asked:

> What would be the best way to dealy the execution of a cf
> tamplate by x amount of seconds?

Simplest way:

  <CFSET Sleep=5>
  <CFSET Start=GetTickCount()>
  <CFTRY>
  <CFLOCK SCOPE="SESSION" TIMEOUT="#Sleep#" TYPE="READONLY">
    <CFLOCK SCOPE="SESSION" TIMEOUT="#Sleep#" TYPE="EXCLUSIVE">
    </CFLOCK>
  </CFLOCK>
  <CFCATCH></CFCATCH>
  </CFTRY>
  <CFSET End=GetTickCount()>
  <CFSET Elapsed=End-Start>
  <CFOUTPUT>Elapsed: #Elapsed#ms</CFOUTPUT>

Of course, this will lock your entire session.  Anything else trying to
obtain a lock in that sessionwill also be delayed.

-R

Rick Osborne
Certified Advanced ColdFusion 5 Developer

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to