Function setYieldIntervalOverride

  • Override the throttle interval used by every subsequent yieldToHost call that doesn't pass its own intervalMs. Returns the previous override (which the caller should restore in a finally block) so overrides nest cleanly across nested loaders.

    The intended use is: a loader/exporter's top-level entry reads the new yieldIntervalMs option from ModelLoadOptions / ModelExportOptions and pushes it here, so every yieldToHost deeper in the parser picks it up without each call site having to thread the value through. Larger intervals (e.g. 100ms ≈ 10 Hz) noticeably speed up large loads at the cost of less-frequent UI updates; the default 16ms (≈ 60 Hz) keeps animation smooth but the setTimeout(0) overhead at every yield can accumulate to a meaningful slice of a multi-second load.

    Pass undefined to clear the override and return to the library default (16ms).

    Parameters

    • intervalMs: number

    Returns number

    The previous override value, for restoration.