MCPcopy Create free account
hub / github.com/adobe/react-spectrum / missedFrames

Function missedFrames

perf/report.mjs:21–30  ·  view source on GitHub ↗
(intervals)

Source from the content-addressed store, hash-verified

19// skipped n - 1 frames. The period is the trial's median interval, so it adapts to
20// the display rate and holds while fewer than half the frames are late.
21export function missedFrames(intervals) {
22 if (!intervals.length) {
23 return null;
24 }
25 let period = percentile(intervals, 0.5);
26 return intervals.reduce(
27 (missed, interval) => missed + Math.max(0, Math.round(interval / period) - 1),
28 0
29 );
30}
31
32export function metrics(sample) {
33 let interactions = new Map();

Callers 2

report.test.mjsFile · 0.90
metricsFunction · 0.85

Calls 1

percentileFunction · 0.85

Tested by

no test coverage detected