useFps

A React Hook that returns the current frames per second (FPS) of the browser.

Demo

Source
Active:
false
FPS:
0

Usage

See API for more details.

Source

Click links below to view source on GitHub.

API

const { fps, ...controls } = useFps(options)

Options

export type UseFpsOptions = { /** * Calculate the FPS on every x frames. * * @defaultValue 10 */ every?: number }

Returns

Retuerns contain Pausable instance that can be paused, resumed.

See Pausable for more details.

export type UseFpsReturns = Pausable & { /** * Current FPS */ fps: number }