You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
AFAIK W3C isn't a spec for Node, but we try to match browser behavior as much as possible. Would we break anything in Node if we change time origin? How badly are we breaking the module ecosystems by introducing this change?
W3C isn't a spec for Node, but we try to match browser behavior as much as possible
The performance interface was written to conform to the W3C spec.
Browsers all perform the way as described in the spec, but the recent Meltdown/Spectre mitigations include reducing performance's precision in general: w3c/hr-time#56
Would we break anything in Node if we change time origin?
Not that I am aware.
How badly are we breaking the module ecosystems by introducing this change?
I expect near-zero breakage since this is a relatively new API.
Activity
fhinkel commentedon Jan 14, 2018
AFAIK W3C isn't a spec for Node, but we try to match browser behavior as much as possible. Would we break anything in Node if we change time origin? How badly are we breaking the module ecosystems by introducing this change?
TimothyGu commentedon Jan 14, 2018
The
performanceinterface was written to conform to the W3C spec.Browsers all perform the way as described in the spec, but the recent Meltdown/Spectre mitigations include reducing
performance's precision in general: w3c/hr-time#56Not that I am aware.
I expect near-zero breakage since this is a relatively new API.
perf_hooks: fix timing
perf_hooks: fix timing
perf_hooks: fix timing
perf_hooks: fix timing
perf_hooks: fix timing
perf_hooks: fix timing
perf_hooks: fix timing
perf_hooks: fix timing
perf_hooks: fix timing