perf_hooks
Usage in Deno
import * as mod from "node:perf_hooks";
This module provides an implementation of a subset of the W3C Web Performance APIs as well as additional APIs for Node.js-specific performance measurements.
Node.js supports the following Web Performance APIs:
import { PerformanceObserver, performance } from 'node:perf_hooks';
const obs = new PerformanceObserver((items) => {
console.log(items.getEntries()[0].duration);
performance.clearMarks();
});
obs.observe({ type: 'measure' });
performance.measure('Start to Now');
performance.mark('A');
doSomeLongRunningProcess(() => {
performance.measure('A to Now', 'A');
performance.mark('B');
performance.measure('A to B', 'A', 'B');
});
Classes Jump to heading
cv
cv
cv
c
PerformanceNodeTiming
This property is an extension by Node.js. It is not available in Web browsers.
cv
cv
cv
PerformanceResourceTiming
Provides detailed network timing data regarding the loading of an application's resources.
Functions Jump to heading
f
f
Interfaces Jump to heading
I
I
I
I
I
I
I
I
I
I
I
Namespaces Jump to heading
N
Type Aliases Jump to heading
T
T
T
Variables Jump to heading
v
v
v
v
v
v
v
v
v
v
v
v