Skip to content

Instantly share code, notes, and snippets.

@grav
Created December 16, 2018 12:03
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 grav/862e8917a2f05c22831da27964c12d1f to your computer and use it in GitHub Desktop.
Save grav/862e8917a2f05c22831da27964c12d1f to your computer and use it in GitHub Desktop.
function sleep(s){
return new Promise(function(resolve,reject) {
setTimeout(_ => {
resolve();
}, 1000 * s);
});
}
async function start(){
while(true){
console.log("while start")
await sleep(2);
}
}
start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment