npm.io
2.1.0 • Published 5 years ago

run-with-fps

Licence
MIT
Version
2.1.0
Deps
0
Size
1 kB
Vulns
0
Weekly
0
Stars
2

run-with-fps

Runs a function with given FPS

Usage

import runWithFPS from 'run-with-fps';

const stop = runWithFPS((delta) => {
  console.log(delta); // ms between prev and current frame
  // draw something here
}, 60);

stop(); // this will stop running