Reduces a sample of durations (milliseconds) to summary statistics. Pure:
no side effects, no clock reads — the durations are supplied by the
caller, whether they came from GPU timestamp queries or the CPU
frame-delta fallback (see frame-timing.ts).
durationsMs.length === 0 returns EMPTY_STATS (count: 0, every other
field null) rather than computing 0s — a percentile or a mean over an
empty array is either NaN (misreported as a real "instant" frame) or a
divide-by-zero, and either would read as "this was fast" instead of "this
was never measured".
Reduces a sample of durations (milliseconds) to summary statistics. Pure: no side effects, no clock reads — the durations are supplied by the caller, whether they came from GPU timestamp queries or the CPU frame-delta fallback (see
frame-timing.ts).durationsMs.length === 0returnsEMPTY_STATS(count: 0, every other fieldnull) rather than computing0s — a percentile or a mean over an empty array is eitherNaN(misreported as a real "instant" frame) or a divide-by-zero, and either would read as "this was fast" instead of "this was never measured".