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

Function syncFrame

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

Source from the content-addressed store, hash-verified

209 }
210
211 const syncFrame = (at: number) => {
212 trim(fps, span, at)
213 const total = fps.reduce((sum, entry) => sum + entry.dur, 0)
214 const gap = fps.reduce((max, entry) => Math.max(max, entry.dur), 0)
215 const jank = fps.filter((entry) => entry.dur > 32).length
216 batch(() => {
217 setState("fps", total > 0 ? (fps.length * 1000) / total : undefined)
218 setState("gap", gap > 0 ? gap : undefined)
219 setState("jank", jank)
220 })
221 }
222
223 const syncLong = (at = performance.now()) => {
224 if (!hasLong) return

Callers 1

loopFunction · 0.85

Calls 3

batchFunction · 0.85
setStateFunction · 0.85
trimFunction · 0.70

Tested by

no test coverage detected