<cfscript>
function sleep(timeMillis) {
                var thread = createObject("java", "java.lang.Thread");
                thread.sleep(timeMillis);
}
</cfscript>

This was from Robert Everland III a few posts back: (Multiple CFMail
Problem).  I included the original post below.
--------------------------------------------------


The only problem with that is that for as long as you want cf to sleep it
will loop and loop and loop and loop and loop and loop. It would be like
telling a taxi driver to drive for 5 minutes while you get your bags instead
of telling him to shut off the car to conserve gas. Here is a UDF I found
that uses a java com object to sleep. Works beautifully.

<cfscript>
function sleep(timeMillis) {
                var thread = createObject("java", "java.lang.Thread");
                thread.sleep(timeMillis);
}
</cfscript>


Robert Everland III
Dixon Ticonderoga
Web Developer Extraordinaire




> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 11, 2002 4:29 PM
> To: CF-Talk
> Subject: RE: Pausing using CF
>
>
> make you wish CF had a noop tag. ;)
>
> Anthony Petruzzi
> Webmaster
> 954-321-4703
> [EMAIL PROTECTED]
> http://www.sheriff.org
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 11, 2002 4:30 PM
> To: CF-Talk
> Subject: RE: Pausing using CF
>
>
> That's a good way to peak out your processor at 100%.  If you do this a
> lot, it's gonna kill your performance.
>
> I'd imagine a better way to do it would be to invoke the native "sleep"
> function in the win32 api - there's a cfx_sleep (freeware on tag
> exchange); I'm not sure if it does this.
>
> ---
> Billy Cravens
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 09, 2002 8:02 AM
> To: CF-Talk
> Subject: RE: Pausing using CF
>
> <cfscript>
> /**
>  * Pauses the processing for CF for a specified amount of time
>  *
>  * @param seconds  number of seconds you would like to pause CF for
>  * @author Tony Petruzzi ([EMAIL PROTECTED]
>  * @version 1, April, 09 2002
>  */
>       function PauseCF(seconds){
>               var currenttime = now();
>               while(DateDiff("s", currenttime, now()) LTE seconds){
>                       continue;
>               }
>       }
> </cfscript>
>
>
> Here is a function a wrote to do this. All you have to do to use it is
> assign the function to a variable.
>
> <cfset temp = PauseCF(10)>
>
> Have fun!
>
> Anthony Petruzzi
> Webmaster
> 954-321-4703
> http://www.sheriff.org
>
>
> -----Original Message-----
> From: Michael Tangorre [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 08, 2002 7:53 PM
> To: CF-Talk
> Subject: Pausing using CF
>
>
> Hello.
>
> Can anyone think of a way that I can achieve a pause for like 30 seconds
> to
> a minute between iterations in a loop?
>
> would another loop inside work that did nothing or is there a better
> way?
>
> Mike
>
>
>
>
>
>
> 
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to