Shaun Mccran

My digital playground

23
F
E
B
2009

Ever needed to make a template 'sleep' for a defined period?

One of the code snippets I've had scattered around is a short java command to make the current thread sleep, for a set period.

Its handy if you want to add a set period of delay to an application, for any reason.

view plain print about
1<cfscript>
2
3thread = createObject("java", "java.lang.Thread");
4thread.sleep(javaCast("long", 5000));
5
6
</cfscript>

It creates the java thread object, and uses the sleep method to pause the thread for whatever numeric value you give it. In this example 5000ms.

TweetBacks
Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Back to top