I did some tests on Chrome and requestAnimationFrame
yielded 61 fps while setTimeOut( callback, 0 )
, yielded 233 fps.
If one would like to have more than 61 fps (which I'm not sure what for) but wouldn't it be better to render with setTimeOut and just use requestAnimationFrame to detect when the window lost focus and then stop the timeouts until the focus returns?
And a side question: is there another way to detect when the window loses focus other than requestAnimationFrame not calling the callback?