News for hackers. Stuff that matters.
Re:Windows Timer Resolution: The Great Rule Change by rwallace on Monday October 05, 2020 @04:23AM (#24685675)
> One case where timer-based scheduling is needed is when implementing a web browser. The JavaScript standard has a function called setTimeout which asks the browser to call a JavaScript function some number of milliseconds later. Chromium uses timers (mostly WaitForSingleObject with timeouts rather than Sleep) to implement this and other functionality. This often requires raising the timer interrupt frequency.

Why does it require that? Timeouts should normally be on the order of minutes. Why does Chrome need timer interrupts to happen many times per second?

Re:Windows Timer Resolution: The Great Rule Change by Sniffnoy on Monday October 05, 2020 @04:39AM (#24685751)
This isn't the browser's network timeouts, this is the JavaScript function setTimeout() which can be used in scripts and which, as mentioned, takes an argument in milliseconds. Chrome needs to be able to support whatever setTimeout() call a website might make, and those are rarely going to be minutes long; setTimeout() is just used for "call this function after a specified amount of time". The fact that the word "timeout" is used in the name does not mean that it has any relation to network timeouts!
Re:Windows Timer Resolution: The Great Rule Change by hoseja on Monday October 05, 2020 @06:34AM (#24686349)
There is still the question why the script needs higher than standard timer resolution.
Re:Windows Timer Resolution: The Great Rule Change by account42 on Wednesday October 07, 2020 @11:56AM (#24709484)
Higher than Windows' standard timer resolution, which is abysmal.
Re:Windows Timer Resolution: The Great Rule Change by wolf550e on Monday October 05, 2020 @05:52AM (#24686120)
JavaCcript setTimeout is used for animations.
Re:Windows Timer Resolution: The Great Rule Change by sdflhasjd on Monday October 05, 2020 @06:01AM (#24686189)
This is exactly why requestAnimationFrame is a thing though.
Re:Windows Timer Resolution: The Great Rule Change by skykooler on Monday October 05, 2020 @08:13PM (#24693543)
Browsers need to try and properly display webpages written before requestAnimationFrame was introduced.
Re:Windows Timer Resolution: The Great Rule Change by wolf550e on Monday October 05, 2020 @10:46AM (#24688219)
Lots of old code exists though.