1.0.1 • Published 9 years ago

afo-interval v1.0.1

Weekly downloads
3
License
BSD-3-Clause
Repository
github
Last release
9 years ago

Interval

A simple OOP-style wrapper for setInterval.

var Interval = require('afo-interval');

var timer = new Interval(function(){
    console.log(new Date().toISOString());
},1000,true); // every 1s, automatically start

timer.pause(); // pause it

timer.resume(); // resume it

timer.unref(); // unref it

timer.ref(); // re-ref it

// ... and more

// auto-start is optional, defaults to false
new Interval(function(){},1000);