Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...
    Index
    • Parameters

      • windowMs: number

        Sliding sample window (frames older than newest - windowMs fall out of the estimate)

      • minRetainedSamples: number = DEFAULT_MIN_RETAINED_SAMPLES

        Samples never trimmed away regardless of age (default 2 — the minimum getFPS()/span() need to report anything at all; see the class comment). CLAMPED to at least 2: the retention floor is a correctness invariant, not a preference, and a caller passing 0 or 1 would silently restore the undefined-estimate failure it exists to prevent. A NON-FINITE value is treated as ABSENT and falls back to the default before the clamp (Math.max propagates NaN, and Infinity would mean "never trim" — an unbounded window that is no longer sliding).

      Returns FPSTracker

    timestamps: number[] = []
    startIndex: number = 0
    minRetainedSamples: number
    windowMs: number

    Sliding sample window (frames older than newest - windowMs fall out of the estimate)

    • Record a frame timestamp and trim samples older than the window, stopping at minRetainedSamples so a frame rate slower than the window itself still yields a defined estimate.

      Parameters

      • timestamp: number

      Returns void

    • Interval-normalized FPS over the current window; 0 when fewer than two samples (or a degenerate non-positive span) — callers treat 0 as "not enough data to decide".

      Returns number