Created
January 7, 2020 16:26
-
-
Save aranajhonny/c4ffc081b99528646173edb1442df6b0 to your computer and use it in GitHub Desktop.
wait (n) miliseconds in async / await js
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
| // declaracion | |
| function wait(ms) { | |
| return new Promise(resolve => setTimeout(resolve, ms)) | |
| } | |
| // uso | |
| await wait(200); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment