Created
August 22, 2017 14:33
-
-
Save CodeLenny/80fc0afee9974530b44df3acd06fa8a3 to your computer and use it in GitHub Desktop.
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
<script> | |
/** | |
* Delays the given number of milliseconds. | |
* @param {Number} ms the number of milliseconds to delay. | |
* @return {Promise} resolves after the delay has finished. | |
*/ | |
Promise.delay = (ms) => new Promise(resolve => setTimeout(resolve, ms)); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment