MCPcopy Create free account
hub / github.com/anomalyco/opencode / loop

Function loop

packages/app/src/components/debug-bar.tsx:330–351  ·  view source on GitHub ↗
(at: number)

Source from the content-addressed store, hash-verified

328 })
329
330 const loop = (at: number) => {
331 if (document.visibilityState !== "visible") {
332 raf = 0
333 return
334 }
335
336 if (last === 0) {
337 last = at
338 raf = requestAnimationFrame(loop)
339 return
340 }
341
342 fps.push({ at, dur: at - last })
343 last = at
344
345 if (at - snap >= 250) {
346 snap = at
347 syncFrame(at)
348 }
349
350 raf = requestAnimationFrame(loop)
351 }
352
353 const stop = () => {
354 if (raf !== 0) cancelAnimationFrame(raf)

Callers

nothing calls this directly

Calls 2

syncFrameFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected