performance.now() by default, override with your own timestamps if necessary
♻️ Automatically resets when pausing between taps
;const counter = ;
tap() method with a touch or click event.
Optionally you can pass timestamps in ms.
Or initialize with an array of timestamps in ms.
const counter = 0 500 1000 1500;
To read the BPM:
Waiting 1.5 * average interval length will reset the counter. To reset manually:
yarn add bpm-counter
npm install bpm-counter
- TSDX – Zero-config CLI for TypeScript package development