fix(studio): prevent negative timeline latency telemetry (#2905)

This commit is contained in:
Miguel Ángel
2026-07-30 22:29:34 +02:00
committed by GitHub
parent f75ca076b7
commit b813b17345
2 changed files with 69 additions and 3 deletions
@@ -87,7 +87,7 @@ export function useTimelinePerformanceTelemetry(context: TimelinePerformanceCont
state.pendingScrollStartedAt = now;
state.frameRequest = requestAnimationFrame((frameAt) => {
state.frameRequest = 0;
state.frameLatencies.push(frameAt - state.pendingScrollStartedAt);
state.frameLatencies.push(performance.now() - state.pendingScrollStartedAt);
if (state.previousFrameAt !== null) {
state.frameIntervals.push(frameAt - state.previousFrameAt);
}