by tgb · 10y ago · 0 comments
var now = Date.now()/1000;
var dt = now - then;
Adding this line fixes it: dt = dt > 1 ? 1 : dt;
[1] https://github.com/grondilu/grondilu.github.io/blob/47d41d/p...> The callback rate may be reduced to a lower rate when running in background tabs or in hidden <iframe>s in order to improve performance and battery life.
[1] https://developer.mozilla.org/it/docs/Web/API/window/request...