tinybench - v6.1.1
    Preparing search index...

    Function classifyTimerSaturation

    • Classifies timer saturation in a latency sample set.

      Criteria are evaluated in the fixed order 'zero-dominated''low-distinct''zero-mad'; the first match wins. Fewer than 10 samples are never classified — with so few measurements the criteria cannot reliably distinguish a deterministic fast function from one truly limited by the timer grain.

      The distinct-value count is computed in O(n) by exploiting the sorted-ascending invariant of samples and short-circuits as soon as the threshold is reached.

      Parameters

      Returns TimerSaturationReason | undefined

      the saturation reason, or undefined when no criterion fires