Closed imrehg closed 11 years ago
Sorry for delay in reviewing this.... been a bit busy.
The code looks great - thanks!
Before I merge, I just want to test on a handful of browsers. I'll do this later this week.
-Joe
No problem at all, thanks a lot for the detailed feedback, it made the code so much better! :)
The original method of setTimeout for animation drains on system resources if the tab is not visible, It is somewhat mitigated by some of the modern browsers (Chrome and Firefox tested) which set a maximum one setTimeout call per second for background tabs, though this is not a behaviour to be relied upon.
The requestAnimationFrame API aims to fix that with these properties:
The "fps" option is also removed here, since it is now timed by the browser itself. It is by default equivalent to about 60 fps.