Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sleepFor( sleepDuration ){
- console.log("begin sleep");
- var now = new Date().getTime();
- while(new Date().getTime() < now + sleepDuration){ /* do nothing */ }
- console.log("end sleep");
- }
- sleepFor(2000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement