accurate-interval
Create an accurate interval that does not skew over time.
API
var interval = accurateInterval(func, interval, opts)
func
:function
- Function to call ever interval ms. func takes one argument, scheduledTime, which is the timestamp in milliseconds the callback was scheduled for.interval
:number
- Interval (in ms) with which to call func.opts
aligned
:boolean
- Optional. Align timestamps. Default isfalse
.immediate
:boolean
- Optional. Call func immediately as well. Default isfalse
.
Example
var accurateInterval = ;var foo = ; ;
License
MIT