Process
process.hrtime.bigint()
Provides a monotonic high-resolution timestamp as a bigint in nanoseconds. Subtract two samples to measure duration. It does not represent a calendar timestamp and bigint needs conversion before JSON serialization. Tested on Node.js 22.16.0. Example output (one line per entry): ["bigint true"].
Formal Syntax & Structure
nodejs syntaxnodejs
process.hrtime.bigint()Return Value
bigint
High-resolution timestamp in nanoseconds.
Working Example
Example Snippetnodejs
const start = process.hrtime.bigint();const elapsed = process.hrtime.bigint() - start;console.log(typeof elapsed, elapsed >= 0n);