Wednesday, February 17, 2010

A JavaScript sleep function

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

Source: http://www.ozzu.com/programming-forum/javascript-sleep-function-t66049.html

No comments: