Returns a new IntervalTracker instance. IntervalTracker records the interval between each call to mark.
mark
import { interval } from 'https://unpkg.com/ixfx/dist/trackers.js';const t = interval();// Call `mark` to record an intervalt.mark();...t.mark();// Get average time in milliseconds between calls to `mark`t.avg;// Longest and shortest times are available too...t.min / t.max Copy
import { interval } from 'https://unpkg.com/ixfx/dist/trackers.js';const t = interval();// Call `mark` to record an intervalt.mark();...t.mark();// Get average time in milliseconds between calls to `mark`t.avg;// Longest and shortest times are available too...t.min / t.max
Interval tracker can automatically reset after a given number of samples:
// Reset after 100 samplesconst t = interval({ resetAfterSamples: 100} ); Copy
// Reset after 100 samplesconst t = interval({ resetAfterSamples: 100} );
Optional
Options for tracker
New interval tracker
Returns a new IntervalTracker instance. IntervalTracker records the interval between each call to
mark
.Interval tracker can automatically reset after a given number of samples: