Skip to content

Instantly share code, notes, and snippets.

@exhesham
Created December 12, 2021 08:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save exhesham/b8d98c242d8a352c5f3eae2eb6ece9a6 to your computer and use it in GitHub Desktop.
Save exhesham/b8d98c242d8a352c5f3eae2eb6ece9a6 to your computer and use it in GitHub Desktop.
task-executor.ts
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