Timer API that works stable in background tabs
JavaScript
Latest commit f0536f9 Jan 23, 2017 @mohayonao committed on GitHub Update README.md
Permalink
Failed to load latest commit information.
build 1.1.0 Jun 6, 2016
test rest parameters support Dec 6, 2015
.gitignore initial commit Jan 23, 2015
.travis.yml update dev tools Dec 6, 2015
README.md Update README.md Jan 23, 2017
index.js rest parameters support Dec 6, 2015
karma.conf.js update dev tools Dec 6, 2015
package.json 1.1.0 Jun 6, 2016

README.md

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