Commit 13d8398
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 <kamil.ogorek@gmail.com>1 parent 2e11882 commit 13d8398
1 file changed
+33
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
6 | 25 | | |
7 | 26 | | |
8 | 27 | | |
| |||
81 | 100 | | |
82 | 101 | | |
83 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
84 | 114 | | |
85 | 115 | | |
86 | 116 | | |
| |||
261 | 291 | | |
262 | 292 | | |
263 | 293 | | |
264 | | - | |
| 294 | + | |
| 295 | + | |
265 | 296 | | |
266 | 297 | | |
267 | 298 | | |
| |||
0 commit comments