Shadcn Hooks

useFps

A hook to calculate the FPS

Loading...

Installation

npx shadcn@latest add @shadcnhooks/use-fps

API

interface UseFpsProps {
  /**
   * Calculate the FPS on every x frames.
   * @default 10
   */
  every?: number
}

/**
 * A hook to calculate the FPS
 * @param options - The options for the FPS
 * @param options.every - The number of frames to calculate the FPS on
 * @default { every: 10 }
 * @returns The FPS
 */
export function useFps(options?: UseFpsProps): number

Credits

Last updated on

On this page