Created
September 23, 2017 22:58
-
-
Save integrii/9f17b3c226edc8c75455aeb591e3bea9 to your computer and use it in GitHub Desktop.
Sleep in javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://stackoverflow.com/questions/14226803/javascript-wait-5-seconds-before-executing-next-line | |
function wait(ms){ | |
var start = new Date().getTime(); | |
var end = start; | |
while(end < start + ms) { | |
end = new Date().getTime(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment