# collect-fps

> Small module that uses requestAnimationFrame to collect what is the current FPS

Latest version **2.0.0** (published 2017-01-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install collect-fps
pnpm add collect-fps
yarn add collect-fps
bun add collect-fps
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2017-01-17 |
| First published | 2017-01-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | nevon, pirelenito, xaviervia |

## Links

- npm: https://www.npmjs.com/package/collect-fps
- Repository: https://github.com/pirelenito/collect-fps
- Homepage: https://github.com/pirelenito/collect-fps#readme
- Issues: https://github.com/pirelenito/collect-fps/issues
- npm.io page: https://npm.io/package/collect-fps

## Recent versions

- 2.0.0 (latest) — 2017-01-17
- 1.1.0 — 2017-01-16
- 1.0.0 — 2017-01-11

## README

# Collect FPS

[![Build Status](https://travis-ci.org/batata-frita/collect-fps.svg)](https://travis-ci.org/batata-frita/collect-fps)
[![npm version](https://badge.fury.io/js/collect-fps.svg)](https://badge.fury.io/js/collect-fps)

Small module that uses `requestAnimationFrame` to collect what is the current FPS.

## Usage

First install it:

```bash
npm install --save collect-fps
```

Calling it will initialize the collection and return a function. When invoked, that function will stop the collection and return the frame per seconds value (a float number).

```javascript
import collectFPS from 'collect-fps'

const endCollection = collectFPS()

setTimeout(() => {
  const fps = endCollection()
  console.log(fps)
}, 1000)
```

If `requestAnimationFrame` is not available in your runtime, it will throw an error when invoked

## License

[MIT](LICENSE)

---
_Source: https://npm.io/package/collect-fps · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
