Skip to content

Instantly share code, notes, and snippets.

@netsi1964
Created November 6, 2016 09:09
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 netsi1964/74015998b150daef29075461f66ab220 to your computer and use it in GitHub Desktop.
Save netsi1964/74015998b150daef29075461f66ab220 to your computer and use it in GitHub Desktop.
waitFor lets you pause code execution
function waitFor(ms, cb) {
var waitTill = new Date(new Date().getTime() + ms);
while(waitTill > new Date()){};
if (cb) {
cb()
} else {
return true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment