3 ms·
Browser manufacturers changed the behavior of APIs like performance.now() [0] to add slight rounding 'errors' or limit the granularity of timing functions. That
by cmg 5y ago
Browser manufacturers changed the behavior of APIs like performance.now() [0] to add slight rounding 'errors' or limit the granularity of timing functions. That function used to report on the microsecond level in (most) browsers, but now is generally limited to around 1ms due to timing attacks.
[0] https://developer.mozilla.org/en-US/docs/Web/API/Performance/now https://developer.mozilla.org/en-US/docs/Web/API/Performance...
- a-dub 5y agosurely high precision clocks can be constructed via busy waits or random api calls that hit hardware to do things with fixed latency, no?
- silon42 5y agoAll those can be limited, because thankfully JS is not multithreaded (otherwise you could do busy-loop timing).
- staticassertion 5y agoYes, like the SharedArrayBuffer that browsers disabled. There are probably roughly infinite ways to construct clocks. Closing the obvious leaks has been a stop gap while other mitigation techniques are rolling out, like site isolation.