useFps
React Sensor Hooks that tracks FPS (frames per second)
Usage
Live Editor
function Demo() { const fps = useFps(); return <div>FPS: {fps}</div>; };
Result
Loading...
API
useFps
Returns
number
: frames per second
Arguments
Argument | Description | Type | DefaultValue |
---|---|---|---|
options | - | UseFpsOptions | undefined | - |
UseFpsOptions
Property | Description | Type | DefaultValue |
---|---|---|---|
every | Calculate the FPS on every x frames. | number | 10 |