Skip to content

Instantly share code, notes, and snippets.

@artlogic
Created September 26, 2016 20:40
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 artlogic/c83b9671a435a492c5b72344f56e6696 to your computer and use it in GitHub Desktop.
Save artlogic/c83b9671a435a492c5b72344f56e6696 to your computer and use it in GitHub Desktop.
var timeout = 5000; // 5 seconds
var p = new Promise(function (resolve, reject) {
setTimeout(function () {
resolve();
}, timeout);
});
p.then(function () {
console.log('this will run after 5 seconds!');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment