Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

JS sleep function

/**
* Delay for a number of milliseconds
*/
function sleep(delay) {
    var start = new Date().getTime();
    while (new Date().getTime() < start + delay);
}
Source by www.sitepoint.com #
 
PREVIOUS NEXT
Tagged: #JS #sleep #function
ADD COMMENT
Topic
Name
5+5 =