Skip to content

performance.now() returns incorrect value #17892

Closed
@TimothyGu

Description

@TimothyGu
  • Version: v9.x / master
  • Platform: all
  • Subsystem: perf_hooks
$ node -p 'perf_hooks.performance.now()'
174195586.611404

The spec (1 which leads to 2) describes the return value of performance.now() as:

the high resolution time from the time origin to the present time (typically called "now")

where time origin is defined as the point at which the "browsing context is first created", which translates to Node.js as the time Node.js is launched.

In other words, I would expect performance.now() to return a value close to 0 as it is executed as soon as Node.js is launched, rather than process.hrtime() converted to milliseconds as it currently does.

/cc @jasnell

Metadata

Metadata

Assignees

Labels

perf_hooksIssues and PRs related to the implementation of the Performance Timing API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions