I'm developing a browser game and am using the timestep implementation from the famous Fix your timestep! article.
It works perfectly, but there is one problem. If you tab out of the tab and then come back 5 minutes later or so, it freezes, because it has to execute all the missed physics calculations. That is, this code:
accumulator += frameTime;
while (accumulator >= dt)
previousState = currentState;
integrate( currentState, t, dt );
t += dt;
accumulator -= dt;
Seems to have to execute for quite a while because the accumulator has missed so many calculations while the tab was .. sleeping I guess?