peek-performance_bar icon indicating copy to clipboard operation
peek-performance_bar copied to clipboard

fix ajax timing calculation

Open glaszig opened this issue 2 months ago • 0 comments

ajax timings are derived from event.timeStamp values. latest browser improvements in anti-fingerprinting measures made APIs return timestamps with reduced time precision. calculating timings with those values with new Date().getTime() will blow up because it returns a different precision value. the solution is to use performance.now() in place of Date()

https://developer.mozilla.org/en-US/docs/Web/API/Event/timeStamp https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp https://developer.mozilla.org/en-US/docs/Web/API/Performance/now

should resolve #33 should resolve #25

possibly breaking change for older browsers. do we care about those?

glaszig avatar Apr 26 '24 00:04 glaszig