Skip to contentpackage
stable-timer
v0.0.4A timer that is stable in any situation. e.g. tabs in background, the invisible state page.
node any2 depscjsopen source
- license
- MIT
- deps
- 2
- unpacked
- Unknown
- files
- Unknown
- node
- any
$npm install stable-timer@0.0.4 README
GitHub-flavored package documentation.
downloads
Across all versions.
Download trend unavailable.
compatibility
Runtime metadata.
keywords
Tagged topics.
browserifytimerbackgroundworker
versions
Latest published Apr 18, 2015
maintainers
Registry package owners.
contents
stable-timer
A timer that is stable in any situation. e.g. tabs in background, the invisible state page.
Supported Browsers
- Internet Explorer 11+
- Firefox 12+
- Google Chrome 20+
- Safari 6+
- iOS 6.0+
- Android 4.4+
Installation
npm:
$ npm install stable-timer
bower:
$ bower install stable-timer
Example
var stable = require('stable-timer');
var timer1 = stable.setTimeout(function() {
console.log('timer 1', new Date());
}, 500);
console.log('timer 1 is started. timer id = ', timer1);
var timer2 = stable.setInterval(function() {
console.log('timer 2', new Date());
}, 500);
console.log('timer 2 is started. timer id = ', timer2);
var timer3 = stable.setTimeout
License
MIT
install size
Estimated unpacked size across 6 packages.
8.4 kB
Includes dependencies.
dependencies
2 direct dependencies.
nulltask
nulltask@gmail.com
(
function
() {
// never called.
console.log('timer 3', new Date());
}, 15000);
console.log('timer 3 is started. timer id = ', timer3);
var timer4 = stable.setInterval(function() {
// never called.
console.log('timer 4', new Date());
}, 15000);
console.log('timer 4 is started. timer id = ', timer4);
stable.setTimeout(function() {
console.log('clear all timers');
stable.clearTimeout(timer1);
stable.clearInterval(timer2);
stable.clearTimeout(timer3);
stable.clearInterval(timer4);
console.log('all timers were cleared.');
}, 10000);