Last active
July 29, 2019 02:09
-
-
Save hkwon/ec4884f534a08bd20c8f37cd3ad974ab to your computer and use it in GitHub Desktop.
sleep() function in 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
| const util = { | |
| sleep(ms) { // ms: milliseconds | |
| return new Promise(resolve => setTimeout(resolve, ms)); | |
| } | |
| }; | |
| module.exports = util; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment