-
-
Save d3x0r/6d806ac21eb1019c9d54fd3e9ea00b50 to your computer and use it in GitHub Desktop.
This file contains 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
function sleep() { | |
return new Promise((resolve) => { | |
setTimeout(resolve, 2000); | |
}); | |
} | |
async function foo() { | |
while(1) { | |
const bar = // really big array | |
await sleep(); | |
} | |
//foo(); | |
} | |
foo(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment