Bun

class

perf_hooks.PerformanceNodeTiming

class PerformanceNodeTiming

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.

  • readonly bootstrapComplete: 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.

  • readonly detail?: unknown

    Additional detail specific to the entryType.

  • readonly duration: number

    The total number of milliseconds elapsed for this entry. This value will not be meaningful for all Performance Entry types.

  • readonly entryType: 'node'

    The type of the performance entry. It may be one of:

    • 'node' (Node.js only)
    • 'mark' (available on the Web)
    • 'measure' (available on the Web)
    • 'gc' (Node.js only)
    • 'function' (Node.js only)
    • 'http2' (Node.js only)
    • 'http' (Node.js only)
  • readonly environment: number

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

  • readonly idleTime: 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.

  • readonly loopExit: 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.

  • readonly loopStart: 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.

  • readonly name: string

    The name of the performance entry.

  • readonly nodeStart: number

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

  • readonly startTime: number

    The high resolution millisecond timestamp marking the starting time of the Performance Entry.

  • readonly uvMetricsInfo: UVMetrics

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

    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.

  • readonly v8Start: number

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

  • toJSON(): any;