Skip to content

Instantly share code, notes, and snippets.

@jorabin
Last active November 13, 2016 22:44
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 jorabin/f0ce3a82f6c0246f6505f1c0a5526f24 to your computer and use it in GitHub Desktop.
Save jorabin/f0ce3a82f6c0246f6505f1c0a5526f24 to your computer and use it in GitHub Desktop.
Non blocking inline wait ...
// this used to be hard to do ...
async function sleep(period) {
return new Promise((resolve, reject) => setTimeout(() => resolve(true), period));
}
// ...
await sleep(1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment