An accurate timer using requestAnimationFrame() and performance.now(), defaulting to setInterval when needed.
npm install accurate-timerBased on my own (unscientific) measurements, the timer in a node.js environment tends to be accurate to about 3/1000ths of a second. In a browser environment it's a little less than 1/1000ths of a second.
js
var timer = new Timer(, );
` The callback will be called every
interval milliseconds.* start / stop the timer:
`js
timer.start();
timer.stop();
``All done! I hope you enjoy :blush: