Open this example in the interactive library
Source code
import {
performance,
createHistogram,
PerformanceObserver,
} from "node:perf_hooks";
console.log(
(performance.mark("a"),
performance.mark("b"),
performance.getEntriesByType("mark").map((e) => e.name)),
);
Sample output
[ 'a', 'b' ]
