Sleep(ms)
Last updated September 29, 2003
Version: 1 | Requires: ColdFusion MX | Library: UtilityLib
Description:
This function causes the current java thread, ( the current CFMX page request) to go to sleep for a specified number of milliseconds. Not tested with CF5. Found in Pete Freitag's blog (cfm.blogspot.com).
Return Values:
Returns nothing.
Example:
There will be a 2 second delay...
<cfflush>
<cfset Sleep(2000)>
done waiting!
--->
Parameters:
| Name | Description | Required |
|---|---|---|
| ms | Number of miliseconds to sleep. | Yes |
Full UDF Source:
<cfscript>
/**
* Causes the current request to wait for a specified amount of time.
*
* @param ms Number of miliseconds to sleep. (Required)
* @return Returns nothing.
* @author Nathan Strutz (mrnate@hotmail.com)
* @version 1, September 29, 2003
*/
function sleep(ms) {
var thread = createObject("java", "java.lang.Thread");
thread.sleep(ms);
}
</cfscript>
Search CFLib.org
Latest Additions
John Bartlett added
browserDetect
4 day(s) ago
Rob Brooks-Bilson added
listCompare
7 day(s) ago
Stephen Withington added
formToNameValueP...
15 day(s) ago
anthony petruzzi added
parseExcel
20 day(s) ago
Pablo Varando added
returnRandomHEXC...
21 day(s) ago
Top Rated
QueryStringChang...
Rated 5.0, 10 time(s)
formToNameValueP...
Rated 5.0, 5 time(s)
HTMLSafe
Rated 5.0, 4 time(s)
viewCSS
Rated 5.0, 4 time(s)
generateRandomKe...
Rated 5.0, 3 time(s)