New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

accurate-interval

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

accurate-interval

Create an accurate interval that does not skew over time.

latest
Source
npmnpm
Version
1.0.9
Version published
Maintainers
1
Created
Source

accurate-interval

Create an accurate interval that does not skew over time.

NPM

Build Status Coverage Status Dependency Status devDependency Status

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 is false.
    • immediate: boolean - Optional. Call func immediately as well. Default is false.

Example

var accurateInterval = require('accurate-interval');
var foo = accurateInterval(function(scheduledTime) {
    console.log('Actual time: ' + Date.now() + ' -- Scheduled time: ' + scheduledTime);
}, 2000, {aligned: true, immediate: true});

setTimeout(function() {
    foo.clear();
}, 10000);

License

MIT

Keywords

accurate

FAQs

Package last updated on 02 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts