Skip to content

Instantly share code, notes, and snippets.

@j0x0j
Created September 10, 2012 19:13
Show Gist options
  • Save j0x0j/3693084 to your computer and use it in GitHub Desktop.
Save j0x0j/3693084 to your computer and use it in GitHub Desktop.
JS interval ticker
var gameTimer = setInterval('timer()', 1000);
function timer() {
// se llama cada segundo
// podrias tener un var del num de segundos
// y cada ves que llama timer() lo incrementa ++
}
// Cuando acabas, matas el interval
clearInterval(gameTimer);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment