Skip to content

Instantly share code, notes, and snippets.

@d3x0r
Forked from onosendi/script.js
Last active April 13, 2022 18:23
Show Gist options
  • Save d3x0r/6d806ac21eb1019c9d54fd3e9ea00b50 to your computer and use it in GitHub Desktop.
Save d3x0r/6d806ac21eb1019c9d54fd3e9ea00b50 to your computer and use it in GitHub Desktop.
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