This module provides an implementation of a subset of the W3C Web Performance APIs as well as additional APIs for Node.js-specific performance measurements.
See also:
Static variables
staticread onlyconstants:PerfHooksConstants
Constants for garbage collection kinds and flags.
See also:
staticread onlyperformance:Performance
An object that can be used to collect performance metrics from the current Node.js instance.
It is similar to window.performance in browsers.
Also available as js.Node.performance.
See also:
Static methods
staticcreateHistogram(?options:CreateHistogramOptions):RecordableHistogram
staticeventLoopUtilization(?utilization1:EventLoopUtilization, ?utilization2:EventLoopUtilization):EventLoopUtilization
Returns an object that contains the cumulative duration of time the event loop has been both idle and active as a high resolution milliseconds timer.
Module-level alias of performance.eventLoopUtilization().
Added in Node.js v24.12.0 (Active LTS). On earlier versions (including Node.js 22 LTS)
this is undefined at module level; use PerfHooks.performance.eventLoopUtilization instead.
See also:
staticmonitorEventLoopDelay(?options:EventLoopMonitorOptions):IntervalHistogram
Creates an IntervalHistogram object that samples and reports the event loop delay over time.
The delays will be reported in nanoseconds.
This property is an extension by Node.js. It is not available in Web browsers.
See also:
statictimerify<T>(fn:T, ?options:TimerifyOptions):T
Wraps a function within a new function that measures the running time of the wrapped function.
A PerformanceObserver must be subscribed to the 'function' event type in order for the
timing details to be accessed.
This property is an extension by Node.js. It is not available in Web browsers.
Module-level alias of performance.timerify().
Added in Node.js v24.12.0 (Active LTS). On earlier versions (including Node.js 22 LTS)
this is undefined at module level; use PerfHooks.performance.timerify instead.
See also: