Created
December 12, 2021 08:20
-
-
Save exhesham/b8d98c242d8a352c5f3eae2eb6ece9a6 to your computer and use it in GitHub Desktop.
task-executor.ts
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
let taskExecutor = async (task: {delay: number, index: string}) => { | |
console.log(` --> Task ${task.index} started`); | |
await sleep(task.delay); | |
console.log(` <-- Task ${task.index} finished`); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment