Skip to content
This repository has been archived by the owner on Jun 9, 2019. It is now read-only.

mohayonao/worker-timer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

worker-timer

Build Status NPM Version License

Timer API that works stable in background tabs


⚠️ This module does not work in Chrome 55 or later. ⚠️


Installation

npm install worker-timer

downloads:

API

  • setInterval(callback: function, delay: number, ...params: any): number
  • clearInterval(timerId: number): void
  • setTimeout(callback: function, delay: number, ...params: any): number
  • clearTimeout(timerId: number): void

Example

Same as the native Timer API

const WorkerTimer = require("worker-timer");

let count = 0;

WorkerTimer.setInterval(() => {
  count += 1;
  console.log("count: " + count);
}, 1000);

License

MIT

About

Timer API that works stable in background tabs

Resources

Stars

Watchers

Forks

Packages

No packages published