ThePhD / infoware

C++ Library for pulling system and hardware information, without hitting the command line.
Creative Commons Zero v1.0 Universal
410 stars 84 forks source link

CPU Frequency on Windows is bogus #18

Closed melak47 closed 5 years ago

melak47 commented 5 years ago

The windows implementation of iware::cpu::frequency does basically QueryPerformanceFrequency() * 1000 -- which returns completely bogus values. On my machine, QueryPerformanceFrequency returns e.g. 10 MHz, so this reports 10 GHz...

Finding accurate values may be hard, but would it be preferable to return a guesstimate from HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0\~MHz (e.g. 3696 on my machine)?

nabijaczleweli commented 5 years ago

Interesting, it's always returned the correct value for me. Alas!

nabijaczleweli commented 5 years ago

Check the fix/18-winfreq branch, if you'd?

melak47 commented 5 years ago

Works on my machine:tm: 👍

nabijaczleweli commented 5 years ago

Landed in master