logoalt Hacker News

nielsbotyesterday at 7:14 PM3 repliesview on HN

I remember reading that high precision timers can be used for browser fingerprinting and/or for timing attacks, but I didn't anything specifically about setTimeout()/setInterval() after searching a bit.

Also--loosening the accuracy of timers allows the system to optimize CPU power states and save battery. Again, not sure if that's related here.

Maybe someone else here can add more detail.


Replies

samsonraduyesterday at 7:27 PM

You might be referring to the Spectre mitigation changes:

Timer precision from performance.now and other sources is reduced to 1ms (r226495)

https://webkit.org/blog/8048/what-spectre-and-meltdown-mean-...

https://trac.webkit.org/changeset/226495/webkit

show 1 reply
phiretoday at 1:03 AM

That's high precision clocks (aka Preformance.now(), with sub-millisecond resolution) not timers.

The precision of setTimeout has never been high, it kind-of maps to the OS scheduler and the OS scheduler often enforce their own minimum timeouts (Windows has defaulted to 15.625 ms resolution for a very long time, and the newer high resolution timers max out at 1ms across most operating systems)

hinkleyyesterday at 10:41 PM

Don’t unfocused tabs also get throttled? Otherwise we’d all be melting our computers with the 40 open tabs we have. For some of us that’s a slow day.