Last active
March 16, 2017 14:54
-
-
Save gtrufitt/89372b0ae455eb9d0682e6516eebbd76 to your computer and use it in GitHub Desktop.
Test setTimouet
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
function sleep(milliSeconds){ | |
var startTime = new Date().getTime(); // get the current time | |
while (new Date().getTime() < startTime + milliSeconds); // hog cpu until time's up | |
} | |
sleep(2000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment