Timer
!
Version

!
MIT
!
dep
!
size



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