MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / computeTickTiming

Function computeTickTiming

packages/node/src/worker/tickTiming.ts:16–25  ·  view source on GitHub ↗
(fpsCap: number)

Source from the content-addressed store, hash-verified

14}
15
16export function computeTickTiming(fpsCap: number): TickTiming {
17 const safeFpsCap = sanitizeFpsCap(fpsCap);
18 const intervalFromFps = Math.max(MIN_EVENT_POLL_INTERVAL_MS, Math.floor(1000 / safeFpsCap));
19 const tickIntervalMs = Math.min(MAX_EVENT_POLL_INTERVAL_MS, intervalFromFps);
20 const maxIdleDelayMs = Math.max(
21 MIN_IDLE_BACKOFF_MS,
22 Math.min(MAX_IDLE_BACKOFF_MS, tickIntervalMs * 8),
23 );
24 return Object.freeze({ tickIntervalMs, maxIdleDelayMs });
25}
26
27export function computeNextIdleDelay(
28 currentIdleDelayMs: number,

Callers 2

startTickLoopFunction · 0.85
tickTiming.test.tsFile · 0.85

Calls 1

sanitizeFpsCapFunction · 0.85

Tested by

no test coverage detected