SlimIO - Node.js Driftless Interval Timer. This package is inspired by driftless
⚠️ This package is experimental (Please dont use it outside).
- Node.js v12 or higher
This package is available in the Node Package Repository and can be easily installed with npm or yarn.
$ npm i @slimio/timer
# or
$ yarn add @slimio/timer
Node.js timer (interval and timeout) drift with the time. This package aim to implement a no-drift setInterval.
const timer = require("@slimio/timer");
const timerId = timer.setInterval(() => {
console.log("hello world!");
}, 1000);
// Later...
timer.clearInterval(timerId);
Create a new interval. Same API as Node.js !
Clear a given interval id (the number returned by setInterval).
This project have no dependencies.
MIT