Skip to content

Instantly share code, notes, and snippets.

@kirkegaard
Created March 29, 2011 07:42
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kirkegaard/891953 to your computer and use it in GitHub Desktop.
Save kirkegaard/891953 to your computer and use it in GitHub Desktop.
Neat way to force setInterval into running the function at start and every two seconds after that
var interv = setInterval((function() {
console.log('DING DING DING');
return arguments.callee;
})(), 2000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment