logoalt Hacker News

paulddrapertoday at 4:06 PM1 replyview on HN

> This is because NewV7 assumes that the wallclock timer always has microsecond or nanosecond precision, though a browser's wallclock (new Date.getTime()) is millisecond precision.

That's true of Date, but not Temporal, which supported in most cases. [1]

There needs to be a fallback, but when supported `Temporal.Now.instant()` is the solution.

[1] https://caniuse.com/?search=temporal


Replies

john_strinlaitoday at 4:53 PM

that wont work with anti-fingerprinting, which rounds

>In Firefox, the privacy.reduceTimerPrecision preference is enabled by default and defaults to 2ms.

show 1 reply