1 function sleep(delay) { 2 var start = (new Date()).getTime(); 3 while((new Date()).getTime() - start < delay) { 4 continue; 5 } 6 }