mirror of
https://github.com/thilo-behnke/wasm-pong.git
synced 2026-07-11 02:29:25 +00:00
performance/improvements-for-fps-throtteling
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user