Creates a yield gate.
Optional_budgetMs: numberMinimum wall time between yields, in milliseconds. Defaults to ACCM_DEFAULT_UI_YIELD_BUDGET_MS.
Minimum wall time between yields, in milliseconds.
Marks the timeline without yielding (e.g. after an explicit paint wait). Resets the budget clock so the next maybeYield waits a full budgetMs from this point.
Yields when at least budgetMs has elapsed since the last completed yield (or since construction / mark).
OptionalyieldFn: () => Promise<void>Async yield implementation. Defaults to accmYieldToUi.
Whether a yield actually ran.
Time-budgeted cooperative yields: only awaits accmYieldToUi when at least
budgetMsof wall time has elapsed since the previous yield completed.Typical usage: construct one gate per long job, then
await gate.maybeYield()inside each loop iteration.