diff options
| author | brian cully <bjc@spork.org> | 2025-12-26 16:59:01 -0500 |
|---|---|---|
| committer | brian cully <bjc@spork.org> | 2025-12-26 16:59:01 -0500 |
| commit | 9b2b88e70e49b4e79ab1bc72eaee2c3a11ebfb28 (patch) | |
| tree | 855f31a69f2c66aea991fc4c6b7b6fbc7cdf6701 /site/main.mjs | |
| parent | a2dfebbcdc54870bb4a56545bde828f3fbbe48d9 (diff) | |
| download | polyring-9b2b88e70e49b4e79ab1bc72eaee2c3a11ebfb28.tar.gz polyring-9b2b88e70e49b4e79ab1bc72eaee2c3a11ebfb28.zip | |
try to calculate fps in spite of fingerprinting
Diffstat (limited to 'site/main.mjs')
| -rw-r--r-- | site/main.mjs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/site/main.mjs b/site/main.mjs index 280ee43..f3571ec 100644 --- a/site/main.mjs +++ b/site/main.mjs @@ -222,10 +222,14 @@ async function loaded() { }; let lastTime = document.timeline.currentTime; + let interCount = 0; function render(t) { if (t > lastTime) { - fps.textContent = Math.floor(1_000 / (t - lastTime)); + fps.textContent = Math.floor(1_000 * interCount / (t - lastTime)); lastTime = t; + interCount = 0; + } else { + interCount++; } ctx.clearRect(0, 0, canvas.width, canvas.height); |
