xtimer
Lightweight solution for timers with timeouts and intervals
Install
npm install xtimer
Get started
This peace of code
const timer =
Will output into the console every second without timeout
1 'second' { a: 1 }
Options
It's the object to pass into timer
function
required | name | type | description | default |
---|---|---|---|---|
yes | callback |
Function |
function to execute | |
no | args |
Array |
arguments to pass into callback |
[] |
no | interval |
Number |
time in ms between callback calls |
100 |
no | timeout |
Number |
timeout before first call | 0 |