So I'm trying to import around 10,000 records through loops in CF, because I have to tack in some additional info for each record... fun. I'd like to sleep the process for a bit, but CF doesn't have a built in method for that... Java objects to the rescue.
Java Object Sleep in CF
<cfset objThread = CreateObject("java", "java.lang.Thread")>
<cfset objThisThread = objThread.currentThread()>
But, as someone at House of Fusion warns:
[The] thread [is] in the queue sleeping, and so if you have configged CF to use max 20 CF threads, and you sleep 20 threads, no requests will be handled by the server unless one of the threads gets free.
<!--- Sleep current thread for 5 seconds --->