MCPcopy Index your code
hub / github.com/ChartGPU/ChartGPU / updateLoop

Function updateLoop

examples/candlestick-streaming/main.ts:505–526  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

503
504function startStatsLoop() {
505 function updateLoop() {
506 frameCount++;
507 const now = performance.now();
508
509 // FPS calculation (every 500ms)
510 if (now - lastFpsTime >= 500) {
511 fps = Math.round(frameCount / ((now - lastFpsTime) / 1000));
512 frameCount = 0;
513 lastFpsTime = now;
514 }
515
516 // Ticks/sec calculation
517 if (now - lastTickTime >= 1000) {
518 const currentTicks = tickSimulator.getTickCount();
519 ticksPerSec = currentTicks - lastTickCount;
520 lastTickCount = currentTicks;
521 lastTickTime = now;
522 }
523
524 updateStats();
525 requestAnimationFrame(updateLoop);
526 }
527 requestAnimationFrame(updateLoop);
528}
529

Callers

nothing calls this directly

Calls 2

updateStatsFunction · 0.85
getTickCountMethod · 0.80

Tested by

no test coverage detected