node:perf_hooks

Performance timeline, observers, and histogram helpers.

The module shares its performance timeline and constructors with the web Performance globals:

import { performance } from "node:perf_hooks";

performance.mark("start");
performance.measure("work", "start");
console.log(performance.getEntriesByName("work").length); // 1

Exports include performance, now, mark/measure/query/clear helpers, Performance constructors, nodeTiming, createHistogram, monitorEventLoopDelay, eventLoopUtilization, and timerify.

performance === globalThis.performance, and the module constructors have the same identity as their global counterparts. nodeTiming is also included in performance.getEntriesByType("node").

Compatibility notes

  • constants is an empty object in Elide 1.5.0.
  • nodeTiming.v8Start, loopStart, loopExit, and idleTime are zero.
  • Other startup fields use epoch-millisecond values in Elide 1.5.0, not Node’s usual relative timing scale.

Treat nodeTiming values as Elide-specific until their units are aligned with Node.