Global Timer in Javascript with Multiple Callbacks
- by Mike Beepo
I want to create a global timer object in javascript and then be able to add callbacks to it on the fly. This way I can just use one global timer in my script to execute all actions at a certain interval rather than wasting resources by using multiples.
This is how I want to be able to piece things together:
var timer = new function() {
…