sunify / run-with-fps

Runs a function with given FPS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Runs a function with given FPS


Languages

Language:JavaScript 100.0%