Skip to content

Instantly share code, notes, and snippets.

@thewhodidthis
Created March 10, 2021 14:49
Embed
What would you like to do?
/*
const run = async () => {
await sleep(1000)
console.log("One")
await sleep(1000)
console.log("Two")
}
run()
*/
const sleep = (delay) => new Promise((resolve) => setTimeout(resolve, delay))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment