@lancercomet/fps-counter
v1.0.0
Published
Read fps.
Downloads
4
Readme
@lancercomet/fps-counter
A library to read fps.
Quick start
import { FpsCounter } from '@lancercomet/fps-counter'
const fpsCounter = new FpsCounter()
const unregisterTick = fpsCounter.onTick((fps: number) => {
console.log('Fps:', fps)
})
fpsCounter.start()
// Unregister tick from FpsCounter:
unregisterTick()
// Stop counting:
fpsCounter.stop()
// Read fps directly:
fpsCounter.fps
onTick
triggers every frame.
You can pass use your own throttle function to take it easy.
License
Apache-2.0