I would like to display the actual CPU frequency in my app.
To determine the CPU frequency I use an external Dll to read the CPU TSC register.
The update rate of 1 second would be more than enough, however I cannot figure out how to "loop" the dllcall without locking the other functionality of the GUI (the GUI is unresponsive if the call is looped).
This loop requires a fixed delay (to determine how much the TSC increases).
Also since I want to use as little resources as possible, I would like to set the "polling rate" to 1 second.
Is there any way to loop this call without "freezing" to other functionality of the GUI?
Thanks
To determine the CPU frequency I use an external Dll to read the CPU TSC register.
The update rate of 1 second would be more than enough, however I cannot figure out how to "loop" the dllcall without locking the other functionality of the GUI (the GUI is unresponsive if the call is looped).
[ autoit ]
$DLL=DllOpen("xxx.dll") $TSCInit = DllCall($DLL, "dword", "Rdtsc", "dword*", "", "dword*", "") Sleep(200) $TSCTerm = DllCall($DLL, "dword", "Rdtsc", "dword*", "", "dword*", "") $TSCInitHi = Hex($TSCInit[2], 8) $TSCInitLo = Hex($TSCInit[1], 8) $TSCTermHi = Hex($TSCTerm[2], 8) $TSCTermLo = Hex($TSCTerm[1], 8) $TSCInitHiLo = $TSCInitHi&$TSCInitLo $TSCInitHiLo = Dec($TSCInitHiLo) $TSCTermHiLo = $TSCTermHi&$TSCTermLo $TSCTermHiLo = Dec($TSCTermHiLo) $TSC = $TSCTermHiLo - $TSCInitHiLo $TSC = $TSC * 5 $TSC = $TSC / 1000000 $TSC = Round($TSC, 2)
This loop requires a fixed delay (to determine how much the TSC increases).
Also since I want to use as little resources as possible, I would like to set the "polling rate" to 1 second.
Is there any way to loop this call without "freezing" to other functionality of the GUI?
Thanks