Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Use monotonic clock to compute durations (#2441)
A monotonic clock is monotonically increasing and not subject to system clock adjustments or system clock skew. The difference between any two chronologically recorded time values returned from the Performance.now() method MUST never be negative if the two time values have the same time origin. The same guarantee above does not exist for the difference between two calls to `new Date().getTime()` as used by `timestampWithMs()`. Resources: https://stackoverflow.com/questions/7272395/monotonically-increasing-time-in-javascript https://caniuse.com/#search=performance.now https://www.w3.org/TR/hr-time/#sec-monotonic-clock Co-authored-by: Kamil Ogórek <[email protected]>
- Loading branch information