Socket
Book a DemoInstallSign in
Socket

fractional-timer

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fractional-timer

Best effort sub-millisecond interval timer

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

fractional-timer

The best effort sub-millisecond interval timer.

This module is confirmed to work on the Chrome and node.js. But, the Firefox or the Microsoft Edge may confuse.

Simple Example

let ft = require("fractional-timer");
let ftid = ft.setInterval(()=>{
        ft.clearInterval(ftid);
    }, 0.001); // 1 micro-seconds

Setup

$ npm install fractional-timer

For using on the browser, use browserify or the static methods named setInterval and clearInterval provided by the FractionalTimer class.

APIs

  • setInterval( func , delay ) starts the interval timer process. This returns the timer id.
  • clearInterval(fractional-timer-id) stops the timer.

Both of above exported functions are almost same to the standard version provided except for that the delay duration of setInterval could be set as less than a milliseconds.

CHANGES

  • v1.0.2 - Remove the harmony features that uglify-js does not support.
  • v1.0.1 - Fix the bug that could not work on web-browser. issue#1

LICENSE

This software is released under the MIT License, see LICENSE

Keywords

interval

FAQs

Package last updated on 03 Apr 2017

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