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

Function renderFrame

examples/million-points/main.ts:516–536  ·  view source on GitHub ↗
(ts: number)

Source from the content-addressed store, hash-verified

514 * Auto-schedules next frame only if in benchmark mode for continuous loop.
515 */
516 const renderFrame = (ts: number): void => {
517 rafId = null; // Clear at start (single-shot pattern)
518
519 if (lastFrameTs > 0) frameDtMs.push(ts - lastFrameTs);
520 lastFrameTs = ts;
521
522 if (coordinator && gpuContext?.device) {
523 const t0 = performance.now();
524 coordinator.render();
525 const t1 = performance.now();
526 renderMs.push(t1 - t0);
527 scheduleGpuTimingProbe(t1);
528 }
529
530 updateStatsDom(ts);
531
532 // Auto-schedule next frame only if in benchmark mode (continuous loop)
533 if (benchmarkMode) {
534 rafId = requestAnimationFrame(renderFrame);
535 }
536 };
537
538 /**
539 * Cleanup: stops render loop, disposes GPU resources, cancels observers.

Callers

nothing calls this directly

Calls 3

scheduleGpuTimingProbeFunction · 0.85
updateStatsDomFunction · 0.85
renderMethod · 0.65

Tested by

no test coverage detected