Created
December 6, 2019 17:45
-
-
Save ccondry/2d655efed9fa4b38d1270aa246a23d96 to your computer and use it in GitHub Desktop.
async sleep for 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
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