Skip to content

Instantly share code, notes, and snippets.

@dahngeek
Created November 26, 2013 22:42
Show Gist options
  • Save dahngeek/7667635 to your computer and use it in GitHub Desktop.
Save dahngeek/7667635 to your computer and use it in GitHub Desktop.
Hacer algo cada n segundos
var timerId = setInterval(function() {
// clo que quieres quie se ejecute cada n segundos
}, 1000);
// 1 second = 1000 milliseconds.
//Cuando quieras que se detenga de realizarlo solo le das clear interval:
clearInterval(timerId);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment