News for hackers. Stuff that matters.
Re:JavaScript Timeout and Interval Manager by rudasn on Saturday November 03, 2012 @09:27AM (#4736540)
This would be much much helpful if you had a single timer ticking and would check to see which callbacks it should call on every tick. I would think the goal would be to minimize the amount of timers you have on a page.
Re:JavaScript Timeout and Interval Manager by msfeldstein on Saturday November 03, 2012 @02:34PM (#4737469)
Are timers expensive or something? It seems like having a constantly ticking (and calling back) clock would be more costly.
Re:JavaScript Timeout and Interval Manager by TeeWEE on Saturday November 03, 2012 @10:47AM (#4736711)
What's wrong with widow.setTimeout and window.setInterval?
Re:JavaScript Timeout and Interval Manager by vhiremath4 on Saturday November 03, 2012 @02:39PM (#4737482)
There's nothing wrong with setTimeout and setInterval. This simply gives you a couple of additional things. It gives you a way to have all your timeouts managed by another object, which allows you to see which timers are ticking at any given moment, how many have finished and how much time there is left until the timer fires. I think the big advantage is the last point. This obviously isn't needed for everyone, but, when you do. :-) I may add on to Tock to have some other nifty features in the future. Also, I noted all this in the README, so please read that first.