On this page

C

PerformanceNodeTiming

History
class PerformanceNodeTiming extends PerformanceEntry

This property is an extension by Node.js. It is not available in Web browsers.

Provides timing details for Node.js itself. The constructor of this class is not exposed to users.

P

performanceNodeTiming.bootstrapComplete

History
Type:number

The high resolution millisecond timestamp at which the Node.js process completed bootstrapping. If bootstrapping has not yet finished, the property has the value of -1.

P

performanceNodeTiming.environment

History
Type:number

The high resolution millisecond timestamp at which the Node.js environment was initialized.

P

performanceNodeTiming.idleTime

History
Type:number

The high resolution millisecond timestamp of the amount of time the event loop has been idle within the event loop's event provider (e.g. epoll_wait). This does not take CPU usage into consideration. If the event loop has not yet started (e.g., in the first tick of the main script), the property has the value of 0.

P

performanceNodeTiming.loopExit

History
Type:number

The high resolution millisecond timestamp at which the Node.js event loop exited. If the event loop has not yet exited, the property has the value of -1. It can only have a value of not -1 in a handler of the 'exit' event.

P

performanceNodeTiming.loopStart

History
Type:number

The high resolution millisecond timestamp at which the Node.js event loop started. If the event loop has not yet started (e.g., in the first tick of the main script), the property has the value of -1.

P

performanceNodeTiming.nodeStart

History
Type:number

The high resolution millisecond timestamp at which the Node.js process was initialized.

P

performanceNodeTiming.uvMetricsInfo

History
Type:Object
loopCount:number
Number of event loop iterations.
events:number
Number of events that have been processed by the event handler.
eventsWaiting:number
Number of events that were waiting to be processed when the event provider was called.

This is a wrapper to the uv_metrics_info function. It returns the current set of event loop metrics.

The values are exact up to Number.MAX_SAFE_INTEGER. Use performanceNodeTiming.uvMetricsInfoBigInt to obtain the full 64-bit values reported by libuv.

It is recommended to use this property inside a function whose execution was scheduled using setImmediate to avoid collecting metrics before finishing all operations scheduled during the current loop iteration.

const { performance } = require('node:perf_hooks');

setImmediate(() => {
  console.log(performance.nodeTiming.uvMetricsInfo);
});
import { performance } from 'node:perf_hooks';

setImmediate(() => {
  console.log(performance.nodeTiming.uvMetricsInfo);
});
P

performanceNodeTiming.uvMetricsInfoBigInt

History
Type:Object
loopCount:bigint
Number of event loop iterations.
events:bigint
Number of events that have been processed by the event handler.
eventsWaiting:bigint
Number of events that were waiting to be processed when the event provider was called.

The same as performanceNodeTiming.uvMetricsInfo, except that the values are bigints carrying the full 64-bit range reported by libuv.

Because JSON.stringify() cannot serialize bigint values, this property is not enumerable and is not included in the output of performanceNodeTiming.toJSON(). Copies of performance.nodeTiming made by spreading its enumerable properties, for example, remain serializable.

const { performance } = require('node:perf_hooks');

setImmediate(() => {
  console.log(performance.nodeTiming.uvMetricsInfoBigInt);
});
import { performance } from 'node:perf_hooks';

setImmediate(() => {
  console.log(performance.nodeTiming.uvMetricsInfoBigInt);
});
P

performanceNodeTiming.v8Start

History
Type:number

The high resolution millisecond timestamp at which the V8 platform was initialized.