Created
January 9, 2020 12:31
-
-
Save eoikonomou/65cc2f02734c22ea4fefd9998564b5c8 to your computer and use it in GitHub Desktop.
Sleep function for javascript
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
/** | |
* Sleep for ms milliseconds | |
* @param ms | |
*/ | |
function sleep(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment