Hello Brian.
I briefly thought I wanted to accomplish something
along these lines recently and came up with the
following solution. I've left in some commented lines
that you can un-comment and output to see how many
times this loop'll run while it's hanging your
template execution. As the example reads, it'll hang
for 3 seconds. You could easily change that and/or set
it up as a custom tag to accept any number of seconds.
I wouldn't recommend using it too heavily. Hope this
helps.
<CFSET started = now()>
<!--- set the number of seconds to wait --->
<CFSET finished = DateAdd("s", 3, now())>
<CFSCRIPT>
x = 1;
// re-set the initial var to now() until it catches up
with the number of seconds to wait
while (DateCompare(started, finished, "s") LTE 0) {
started = now();
//writeoutput(x & "... still waiting <br />");
//x = IncrementValue(x);
}
</CFSCRIPT>
---------- Original Message
----------------------------------
from: Brian Ferrigno <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
date: Mon, 29 Oct 2001 16:49:47 -0500
What would be the best way to dealy the execution of a
cf tamplate by x
amount of seconds?
I found CF_aSleep on the allaire dev exchange but
would like to see
what the
code looks like and hints in the right direction would
be great.
Brian Ferrigno
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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