Process

process.uptime()

Returns elapsed seconds since this Node process started. This is not host uptime or a service availability SLO. A process restart resets the measure. Tested on Node.js 22.16.0. Example output (one line per entry): ["true"].

Formal Syntax & Structure

nodejs syntaxnodejs
process.uptime()

Return Value

number

Process uptime in seconds.

Working Example

Example Snippetnodejs
console.log(Number.isFinite(process.uptime()) && process.uptime() >= 0);
Node.js Reference