Open this example in the interactive library
Source code
import {
performance,
createHistogram,
PerformanceObserver,
} from "node:perf_hooks";
console.log(
(() => {
const h = createHistogram();
h.record(10);
h.record(20);
return [h.min, h.max];
})(),
);
Sample output
[ 10, 20 ]
