Created
February 26, 2021 13:15
-
-
Save surendharreddy/c8215fa4e3aec536acca4a61294bda8a 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
| const delay = (ms) => new Promise((res) => setTimeout(res, ms)); | |
| async function execute(count = 0) { | |
| for (let i = 1; i < count; i++) { | |
| // Run logic here | |
| await delay(i * 1000); | |
| } | |
| } | |
| execute(10); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment