Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 481 Bytes

README.md

File metadata and controls

17 lines (13 loc) · 481 Bytes

fl60.js

Very tiny library to make a 60 framelimit.

How to use

fl60(frameFn) -> undefined

Executed once per program - next executions don't have any effect. Sets frameFn as a callback function that will be executed for each frame - 60 times per second. Starts the loop.

getFPS() -> number

Returns current FPS: a value between 0 and 60. If fl60 was never called returns NaN instead.

Implementation

fl60 uses setTimeout under the hood.