Timer.js: a Javascript class similar to the Actionscript 3 one

As I said in my first post, I’m studying Actionscript 3 (from the scratch… I never used it before). One thing that I discovered is that since as3, has been introduced the Timer class, which purpose is to replace the setInterval() function (still available, but to be considered deprecated due to its limits) and provide a more flexible, elegant and OOP way to handle recursive actions (ie: calling N times the same method(s) at a given interval, generally to produce an animation).  Like Actionscript, Javascript offers the setInterval() function, but it lacks a cool class like Timer, so just for fun (but maybe in the future i can use it in production) I’ve realized a similar js class that offers more or less the same functionalities.

Continue reading