Skip to content

Instantly share code, notes, and snippets.

@jonalmeida
Created May 19, 2012 07:05
Show Gist options
  • Save jonalmeida/2729817 to your computer and use it in GitHub Desktop.
Save jonalmeida/2729817 to your computer and use it in GitHub Desktop.
javascript wait function
function wait(callback, delay){
var startTime = new Date().getTime();
while (new Date().getTime() < startTime + delay);
callback();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment