1.0.0 • Published 4 years ago

performance-timing v1.0.0

Weekly downloads
2
License
MIT
Repository
-
Last release
4 years ago

performance-timing npm.io npm.io npm.io

A straight-forward interface to retrieving performance timing metrics.

What does it do for me?

Retrieve metrics if they are available, otherwise, set up an observer to be resolved with extracted entries, then disconnected.

import { getEntries } from 'performance-timing';

const [ navigation ] = await getEntries('navigation'); // PerformanceNavigationTiming{}

More Examples

const [ firstInpt ] = await getEntries('first-input'); // PerformanceEventTiming{}
const resources = await getEntries('resource'); // [PerformanceResourceTiming{}, ...]

Mixed results

const entries = await getEntries('navigation', 'paint');