device-perf-check

1.0.1 • Public • Published

Device Perf Check NPM version

The goal of the library is to determine client's device performance in a naive way by running CPU heavy loop using webworker for the sake of main thread.

Resulted number can then be categorized relatively to the results you get across your clients devices.

Usage

import { measure } from 'device-perf-check';

try {
  const score = await measure(); // something bigger or equal 0
} catch (err) {
  // probably Worker, Blob or Promise not supported
}

or with multiple probes:

import { measure } from 'device-perf-check';

await Promise.all([...Array(10)].map(() => measure()))
// example output: [21, 30, 26, 19, 22, 19, 32, 18, 22, 25]

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i device-perf-check

      Weekly Downloads

      0

      Version

      1.0.1

      License

      MIT

      Unpacked Size

      1.76 kB

      Total Files

      3

      Last publish

      Collaborators

      • elmccd