The skip option allows you to skip the first N calls to the returned function before starting the timer. For example, if you want to skip the first 2 calls:
constelapsed = elapsedSince({ skip:2 });
elapsed(); // First call, timer not started yet. Get NaN elapsed(); // Second call, timer still not started. Get NaN elapsed(); // Third call, returns elapsed time since last `elapsed()` call.
See also:
elapsedOnce if you want to measure a single period, and stop it.
elapsedInterval time between calls
Options to control the elapsed timer. Currently only supports skip which will skip the first N calls to the returned function before starting the timer.
Returns elapsed time since the initial call.
If you want to initialise a stopwatch, but not yet start it, consider:
The
skipoption allows you to skip the first N calls to the returned function before starting the timer. For example, if you want to skip the first 2 calls:See also: elapsedOnce if you want to measure a single period, and stop it. elapsedInterval time between calls