Last active
April 27, 2019 02:36
-
-
Save mugyu/606511b4e44f487e718973b6893b3fe7 to your computer and use it in GitHub Desktop.
Simply JavaScript Sleep function
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
// JavaScript simple sleep function | |
// usage: await sleep(milliseconds) | |
function sleep(milliseconds) { | |
return new Promise(resolve => setTimeout(resolve, milliseconds)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment