Package Exports
- accurate-interval
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (accurate-interval) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
accurate-interval
Create an accurate interval that does not skew over time.
Usage
Call accurateInterval to set the interval.
var accurateInterval = require('accurate-interval')
accurateInterval(func, internval, opts)
Args
func
:function
- Function to call ever interval ms.interval
:number
- Interval (in ms) with which to call func.- opts
aligned
:boolean
- Optional. Align timestamps. Default isfalse
.immediate
:string
- Optional. Call func immediately as well. Default isfalse
.
Example
var accurateInterval = require('accurate-interval');
var foo = accurateInterval(function(expectedTime) {
console.log(Date.now() + ' -- ' + expectedTime);
}, 2000, {aligned: true, immediate: true});
License
MIT