Dev Helpers
← Back

Measure between explicit timestamps

Measure between explicit timestamps using Node.js.

Open this example in the interactive library

Source code

import {
  performance,
  createHistogram,
  PerformanceObserver,
} from "node:perf_hooks";
console.log(performance.measure("phase", { start: 3, end: 8 }).duration);

Sample output

5