Thread.sleep(long)
method, which takes in the number of milliseconds to sleep for.
<cfset thread = CreateObject("java", "java.lang.Thread")> About to sleep for 5 seconds...<cfflush> <cfset thread.sleep(5000)> Done sleeping.
Thread.sleep(long)
method, which takes in the number of milliseconds to sleep for.
<cfset thread = CreateObject("java", "java.lang.Thread")> About to sleep for 5 seconds...<cfflush> <cfset thread.sleep(5000)> Done sleeping.
The Fixinator Code Security Scanner for ColdFusion & CFML is an easy to use security tool that every CF developer can use. It can also easily integrate into CI for automatic scanning on every commit.
Comments
BTW, this also works on CF5!!!!
Two words: Thank you.
I had this error when I patched this code on my template. Pls Help! Unhandled System exception ! Failed to create JavaVM. JNI_CreateJavaVM returned error code JNI_ERR (this may indicate an unrecognized option string)
neat! We have a large CF app that has recently migrated from CF 5. I'm investigating a duplicate thread problem that has been discovered. The app produces a second thread with the same time stamp in the log. I've seen it with inserts into a database where errors are returned when a key is duplicated by the duplicate thread. Is there any way of catching duplicate threads in CF?
This code worked fine when in a CFM to show some text wait 5 seconds and then show some more text. When I moved it to a CFC file the 5 second pause was there but the first set of text did not show up until after the pause. Is this something that can not be done with Components??? Thanks