The performance.now() method returns a high resolution timestamp in milliseconds. It represents the time elapsed since Performance.timeOrigin (the time when navigation has started in window contexts, or the time when the worker is run in Worker and ServiceWorker contexts).
Unlike Date.now, the timestamps returned by performance.now() are not limited to one-millisecond resolution. Instead, they represent times as floating-point numbers with up to microsecond precision.
Also, Date.now() may have been impacted by system and user clock adjustments, clock skew, etc. as it is relative to the Unix epoch (1970-01-01T00:00:00Z) and dependent on the system clock. The performance.now() method on the other hand is relative to the timeOrigin property which is a monotonic clock: its current time never decreases and isn't subject to adjustments.
performance.now specification changes
The semantics of the performance.now() method changed between High Resolution Time Level 1 and Level 2.
Creation of the browsing context (if no prior document), unload prompt (if any), or start of the navigation (as defined in HTML, a few steps before fetch).
The performance.now() method used to be relative to performance.timing.navigationStart property from the Navigation Timing specification. This changed and performance.now() is now relative to Performance.timeOrigin which avoids clock change risks when comparing timestamps across webpages.
The specification (Level 2) requires that performance.now() should tick during sleep. It appears that only Firefox on Windows, and Chromiums on Windows keep ticking during sleep. Relevant browser bugs for other operating systems:
These headers ensure a top-level document does not share a browsing context group with cross-origin documents. COOP process-isolates your document and potential attackers can't access to your global object if they were opening it in a popup, preventing a set of cross-origin attacks dubbed XS-Leaks.
15["In Firefox 57.0.4 the accuracy was reduced to 20 microseconds.", "In Firefox 59 the accuracy was reduced to 2 milliseconds.", "In Firefox 60 the accuracy was increased to 1 millisecond."]
10
15
8
4.4
25
15["In Firefox 57.0.4 the accuracy was reduced to 20 microseconds.", "In Firefox 59 the accuracy was reduced to 2 milliseconds.", "In Firefox 60 the accuracy was increased to 1 millisecond."]