Estimates timer resolution heuristically from a latency sample set.
Returns the smallest positive sample occurring at least twice, or the
smallest positive sample if none repeats. The repeated-value branch ignores
a single isolated low sample; the fallback does not offer that protection.
This is an observed task duration, not a guaranteed bound on timer resolution.
Exploits the sorted-ascending invariant: equal values are contiguous, so
the first strictly-positive value with an equal successor is the smallest
reproduced value, and the first strictly-positive value is the fallback
minimum. Runs in O(1) extra space with an early exit.
Estimates timer resolution heuristically from a latency sample set.
Returns the smallest positive sample occurring at least twice, or the smallest positive sample if none repeats. The repeated-value branch ignores a single isolated low sample; the fallback does not offer that protection. This is an observed task duration, not a guaranteed bound on timer resolution.
Exploits the sorted-ascending invariant: equal values are contiguous, so the first strictly-positive value with an equal successor is the smallest reproduced value, and the first strictly-positive value is the fallback minimum. Runs in O(1) extra space with an early exit.