Timer API that works stable in background tabs
npm install worker-timer> Timer API that works stable in background tabs
```
npm install worker-timer
downloads:
- worker-timer.js
- worker-timer.min.js
- setInterval(callback: function, delay: number, ...params: any): numberclearInterval(timerId: number): void
- setTimeout(callback: function, delay: number, ...params: any): number
- clearTimeout(timerId: number): void
-
Same as the native Timer API
`js
const WorkerTimer = require("worker-timer");
let count = 0;
WorkerTimer.setInterval(() => {
count += 1;
console.log("count: " + count);
}, 1000);
``
MIT