refresh-rate
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

refresh-rate Travis CI Build Status

Get the monitor refresh rate.

NPM Badge

Install

npm install refresh-rate

Usage

const refreshRate = require("refresh-rate");
 
(async () => {
    console.log(await refreshRate());
    //=> 60
 
    console.log(await refreshRate({ sampleCount: 120 }));
    //=> 60
})();

API

refreshRate(options?)

options

Type: object

sampleCount

Type: number
Default: 50

The amount of frame samples to take before computing the refresh rate.

To compute within ±2 frames of error, 50 samples are sufficient. However, if you can afford to wait a few more seconds, 120-200 samples can be taken for a more accurate reading.

Package Sidebar

Install

npm i refresh-rate

Weekly Downloads

104

Version

1.0.0

License

MIT

Unpacked Size

4.35 kB

Total Files

6

Last publish

Collaborators

  • richienb