Run 5 times, with one second delay between calls
t1 = new Timer(500, function(){
console.log(this.count);
if (this.count >= 5) {
this.stop();
}
});
You can put several functions
t2 = new Timer(500, [
function(){if (this.count >= 5) this.stop()},
function(){console.log(this.count)}
]);
Manipulate with all timers
function hi(){console.info("Hi!")}
function whatsUp(){console.info("Whats up?")}
function bye(){console.info("Bye.")}
new Timer(1000, hi);
new Timer(1100, whatsUp);
new Timer(1200, bye);
setTimeout(function(){
Timer.all.pause();
}, 2000);
setTimeout(function(){
Timer.all.run();
}, 3000);
setTimeout(function(){
Timer.all.stop();
}, 4000);
those are javascript getters, he used them to create access to the scoped vars id and delay
if he would have attached those to the instance you can also set them, this way you can only get them