@lancercomet/fps-counter
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@lancercomet/fps-counter

MyWebLibs npm version

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

Readme

Keywords

Package Sidebar

Install

npm i @lancercomet/fps-counter

Weekly Downloads

1

Version

1.0.0

License

Apache-2.0

Unpacked Size

16.4 kB

Total Files

6

Last publish

Collaborators

  • pwch