Created
July 19, 2017 15:12
-
-
Save rtorres90/0c6a9823d84ddd5eaf4f53761487622b to your computer and use it in GitHub Desktop.
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 time expects milliseconds | |
function sleep (time) { | |
return new Promise((resolve) => setTimeout(resolve, time)); | |
} | |
// Usage! | |
sleep(500).then(() => { | |
// Do something after the sleep! | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment