Performance

performance.now()

Returns a high-resolution elapsed time in milliseconds relative to the process performance time origin. Use differences for durations, not as a UTC timestamp. This fixture verifies monotonic ordering rather than asserting a machine-dependent speed. Tested on Node.js 22.16.0. Example output (one line per entry): ["true"].

Formal Syntax & Structure

nodejs syntaxnodejs
performance.now()

Return Value

number

Elapsed milliseconds.

Working Example

Example Snippetnodejs
import { performance } from 'node:perf_hooks';const a = performance.now();console.log(performance.now() >= a);
Node.js Reference