Created
December 16, 2018 12:03
-
-
Save grav/862e8917a2f05c22831da27964c12d1f 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(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