performance/improvements-for-fps-throtteling

This commit is contained in:
Thilo Behnke
2022-07-09 18:34:40 +02:00
parent 536ef2d03e
commit abfe3da36d

View File

@@ -28,8 +28,8 @@
return;
}
lastTime = now - (dtMs % frameThreshold);
elapsed += dtMs;
fn(elapsed / 1_000, dtMs / 1_000);
elapsed += frameThreshold;
fn(elapsed / 1_000, frameThreshold / 1_000);
})();
return () => {
cancelAnimationFrame(frame);