Creates a SampledTimer instance. Must still be added to statistics if it should be logged!
Statistics to use for management.
Name of the timer. Use colons to build a hierarchy.
Maximum samples until the statistics are reset and updated, which may destroy a median computation.
Name of the timer. Use colons to build a hierarchy.
The number of times the timer has reset.
true if timer has been started.
The array of sampled values, its length cannot exceed maxNumSamples.
Statistics to use for management.
Gets the latest measurement. This function may return undefined if no measurement
was done.
Updates the min, max, avg, and median values. Currently, this function is expensive,
as it requires a copy of the sampled values.
Samples the timer. Requires that the timer has started.
the current timer value; -1 if statistics are disabled.
Resets the timer and clears all of its historical values.
Add a single measurement to the sample.
A measurement to add.
Starts the timer. Returns the current time, based on Performance.now().
Stops the timer. Requires that the timer has started.
Generated using TypeDoc
A timer that stores the last
nsamples in a ring buffer.