Skip to content

Instantly share code, notes, and snippets.

@lorenzoongithub
Created June 11, 2015 20:32
Show Gist options
  • Save lorenzoongithub/ce6ae3423b318524327e to your computer and use it in GitHub Desktop.
Save lorenzoongithub/ce6ae3423b318524327e to your computer and use it in GitHub Desktop.
waitUntil.js
//
// An example to show the 'waitUntil' function
//
var x = 0;
setTimeout(function() { x = 1; },1000);
waitUntil(x==1);
setTimeout(function() { x = 2; },2000);
waitUntil(x==2);
setTimeout(function() { x = 3; },3000);
waitUntil(x==3);
'I am done';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment