1.1.0 • Published 4 years ago

fps-run-js v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

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
1.1.0

4 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago