mirror of
https://github.com/imgfloat/server.git
synced 2026-02-05 03:39:26 +00:00
60 fps ticks
This commit is contained in:
@@ -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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user