Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

performance-timing

omrilotan37MIT1.0.0

👓 A straight-forward interface to retrieving performance timing metrics.

PerformanceObserver, PerformanceTiming, PerformanceNavigationTiming, PerformanceResourceTiming, PerformancePaintTiming, PerformanceEventTiming, getEntries, observer, promise, async, await, 👓

readme

performance-timing

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');