Created
January 6, 2016 12:24
-
-
Save parambirs/be963958b688f20cbf98 to your computer and use it in GitHub Desktop.
Sleep in JS
This file contains hidden or 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(); | |
| while (new Date().getTime() < startTime + milliSeconds); | |
| } | |
| sleep(10000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment