60 fps ticks

This commit is contained in:
2026-01-09 01:48:39 +01:00
parent f1f121c56b
commit b53a0d4775

View File

@@ -5,6 +5,7 @@ let channelName = "";
let tickIntervalId = null; let tickIntervalId = null;
let lastTick = 0; let lastTick = 0;
let startTime = 0; let startTime = 0;
const tickIntervalMs = 1000 / 60;
const errorKeys = new Set(); const errorKeys = new Set();
function reportScriptError(id, stage, error) { function reportScriptError(id, stage, error) {
@@ -68,7 +69,7 @@ function ensureTickLoop() {
console.error(`Script ${script.id} tick failed`, error); console.error(`Script ${script.id} tick failed`, error);
} }
}); });
}, 100); }, tickIntervalMs);
} }
function stopTickLoopIfIdle() { function stopTickLoopIfIdle() {