4 ms·
Native code that wants more precision can use rdtsc. JavaScript in the browser should have its timer precision reduced, to prevent timing attacks, but that shou
by brucedawson 8y ago
Native code that wants more precision can use rdtsc. JavaScript in the browser should have its timer precision reduced, to prevent timing attacks, but that should be done by the browser, not the OS.
The reduced precision isn't what really bothers me though - it's the cost. My measurements suggest that QPC is about 25x as expensive as rdtsc on this laptop - expensive enough to make calling it too frequently a problem.
This article explains some of the reasons why rdtsc might not be used to implement QPC, and I'm curious as to which one applies, and how machines this applies to:
https://docs.microsoft.com/en-us/windows/desktop/SysInfo/acquiring-high-resolution-time-stamps#direct-tsc-usage https://docs.microsoft.com/en-us/windows/desktop/SysInfo/acq...