Usage in Deno
import * as mod from "node:perf_hooks";
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.
Node.js supports the following Web Performance APIs:
const { PerformanceObserver, performance } = require('node:perf_hooks'); const obs = new PerformanceObserver((items) => { console.log(items.getEntries()[0].duration); performance.clearMarks(); }); obs.observe({ type: 'measure' }); performance.measure('Start to Now'); performance.mark('A'); doSomeLongRunningProcess(() => { performance.measure('A to Now', 'A'); performance.mark('B'); performance.measure('A to B', 'A', 'B'); });
c
PerformanceEntry
The constructor of this class is not exposed to users directly.
c
PerformanceMark
Exposes marks created via the Performance.mark()
method.
c
PerformanceMeasure
Exposes measures created via the Performance.measure()
method.
c
PerformanceNodeTiming
This property is an extension by Node.js. It is not available in Web browsers.
c
PerformanceObserver
No documentation available
f
createHistogram
Returns a RecordableHistogram
.
f
monitorEventLoopDelay
This property is an extension by Node.js. It is not available in Web browsers.
I
CreateHistogramOptions
No documentation available
I
EventLoopMonitorOptions
No documentation available
I
EventLoopUtilization
No documentation available
I
Histogram
No documentation available
I
IntervalHistogram
No documentation available
I
MarkOptions
No documentation available
I
MeasureOptions
No documentation available
I
NodeGCPerformanceDetail
No documentation available
I
Performance
No documentation available
I
PerformanceObserverEntryList
No documentation available
I
RecordableHistogram
No documentation available
I
TimerifyOptions
No documentation available
N
constants
No documentation available
T
EntryType
No documentation available
T
EventLoopUtilityFunction
No documentation available
T
PerformanceObserverCallback
No documentation available
v
constants.NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE
No documentation available
v
constants.NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY
No documentation available
v
constants.NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED
No documentation available
v
constants.NODE_PERFORMANCE_GC_FLAGS_FORCED
No documentation available
v
constants.NODE_PERFORMANCE_GC_FLAGS_NO
No documentation available
v
constants.NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE
No documentation available
v
constants.NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING
No documentation available
v
constants.NODE_PERFORMANCE_GC_INCREMENTAL
No documentation available
v
constants.NODE_PERFORMANCE_GC_MAJOR
No documentation available
v
constants.NODE_PERFORMANCE_GC_MINOR
No documentation available
v
constants.NODE_PERFORMANCE_GC_WEAKCB
No documentation available
v
performance
No documentation available