Node.js module
perf_hooks
The 'node:perf_hooks' module provides performance measurement APIs based on the User Timing specification. It includes performance.now(), performance.mark, performance.measure, and PerformanceObserver.
Use it to benchmark code execution, measure memory usage, and observe performance entries for timely optimization.
Works in Bun · notes
Missing event loop delay monitoring. It's recommended to use the `performance` global instead of `perf_hooks.performance`.
Functions 4
- perf_hooks.createHistogram()
Returns a
RecordableHistogram. - perf_hooks.eventLoopUtilization()
The
eventLoopUtilization()function returns an object that contains the cumulative duration of time the event loop has been both idle and active as a high resolution… - perf_hooks.monitorEventLoopDelay()
_This property is an extension by Node.js.
- perf_hooks.timerify()
_This property is an extension by Node.js.
Classes 1
- class perf_hooks.PerformanceNodeEntry
_This class is an extension by Node.js.
Interfaces 23
- interface ConnectionTimingInfo
- interface CreateHistogramOptions
- interface EventLoopMonitorOptions
- interface EventLoopUtilization
- interface FetchTimingInfo
- interface Histogram
- interface IntervalHistogram
- interface Performance
EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them.
- interface PerformanceEntry
- interface PerformanceEventMap
- interface PerformanceMark
- interface PerformanceMarkOptions
- interface PerformanceMeasure
- interface PerformanceMeasureOptions
- interface PerformanceNodeTiming
_This property is an extension by Node.js.
- interface PerformanceObserver
- interface PerformanceObserverCallback
- interface PerformanceObserverEntryList
- interface PerformanceObserverInit
- interface PerformanceResourceTiming
- interface RecordableHistogram
- interface TimerifyOptions
- interface UVMetrics