Skip to content

Instantly share code, notes, and snippets.

@gustavopaes
Created May 21, 2011 16: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 gustavopaes/984668 to your computer and use it in GitHub Desktop.
Save gustavopaes/984668 to your computer and use it in GitHub Desktop.
A better javascript setInterval
(function(time) {
function again() {
var procede = yourActionFunction();
if(procede)
setTimeout(again, time);
}
again(time);
})(5000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment