Hacker News new | ask | show | jobs
by gnachman 616 days ago
That wouldn't very well because Date.now() isn't monotonic.
1 comments

There is a monotonic time source available in JavaScript, though: https://developer.mozilla.org/en-US/docs/Web/API/Performance...

As I understand it, the precision of such timers has been limited a bit in browsers to mitigate some Spectre attacks (and maybe others), but I imagine it would still be fine for this purpose.