Skip to content

Instantly share code, notes, and snippets.

@danielt69
Created November 29, 2018 11:05
Show Gist options
  • Save danielt69/407f25f9a3389b5e71bfe29f7cbad300 to your computer and use it in GitHub Desktop.
Save danielt69/407f25f9a3389b5e71bfe29f7cbad300 to your computer and use it in GitHub Desktop.
a simple wait js function using Promise
const wait = ms => new Promise(resolve => setTimeout(resolve, ms));
wait(10000).then(() => saySomething("10 seconds")).catch(failureCallback);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment