Return to Snippet

Revision: 21869
at December 22, 2009 15:33 by abhiomkar


Initial Code
function sleep(delay)
{
    var start = new Date().getTime();
    while (new Date().getTime() < start + delay);
}

//usage
//wait for 3 seconds
sleep(3000);

Initial URL

                                

Initial Description

                                

Initial Title
Sleep/Delay in Javascript

Initial Tags
javascript

Initial Language
JavaScript