Socket
Book a DemoInstallSign in
Socket

fps-run-js

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fps-run-js

A JavaScript utility class that enables fps-throttled function execution.

1.1.0
latest
Source
npmnpm
Version published
Weekly downloads
8
Maintainers
1
Weekly downloads
 
Created
Source

fps-run-js

A JavaScript utility class that enables fps-throttled function execution. Internally, requestAnimationFrame() is arranged to execute a user-provided function at a specified fps. The code is based on this Stack Overflow discussion and its related JSFiddle demo. Node.js support was added using setImmediate() instead of requestAnimationFrame().

The module is compiled as a UMD (Universal Module Definition) module. So it can be consumed by script-tags, AMD loading (require.js), and Node.js.

Usage

npm install fps-run-js, load fps-run.js and in code:

fr = new FpsRun(); // create a runner
fr.start(f, 5); // execute function f() at 5 fps
//...
fr.stop(); // stop execution

Live Demos 🔥

Build

$ npm install  # set up build tools
$ npm run build

Keywords

fps

FAQs

Package last updated on 27 Mar 2020

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.