MCPcopy
hub / github.com/aidenybai/react-grab / idleFrame

Function idleFrame

packages/react-grab/e2e/perf-recorder.ts:319–332  ·  view source on GitHub ↗
(page: Page, frameCount = 1)

Source from the content-addressed store, hash-verified

317};
318
319export const idleFrame = (page: Page, frameCount = 1) =>
320 page.evaluate(
321 (count) =>
322 new Promise<void>((resolveTimer) => {
323 let remaining = count;
324 const tick = (): void => {
325 remaining -= 1;
326 if (remaining <= 0) resolveTimer();
327 else requestAnimationFrame(tick);
328 };
329 requestAnimationFrame(tick);
330 }),
331 frameCount,
332 );
333
334const medianOfNumbers = (values: number[]): number => {
335 if (values.length === 0) return 0;

Callers 1

perf-bench.spec.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…