performance/improvements-for-fps-throtteling

This commit is contained in:
Thilo Behnke
2022-07-09 18:34:40 +02:00
parent 9646be4a68
commit 70e63d1e2e

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);