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);
However, this can't restart the timer with reset dealy times.