On my computer, the TSC (time stamp counter) counts at 3.09 GHz. A call to QueryPerformanceFrequency, or the equivalent kernel side, returns 3.02 MHz. This differs by a factor of 1,024. That is, a system 'tick' is 1024 cycles of the TSC.
I want to set a kernel timer duration for a given number of cycles of the processor. I realize that these days, actual CPU clock speed varies, so I'm content to use the TSC speed, as when a program is running full tilt, the CPU will probably run at that speed (or more if overclocking is enabled).
Anyway, I don't want to assume that the system tick is always 1024 TSC cycles, and I don't want to start my driver spinning for awhile and comparing the difference in rdtsc () and KeQueryPerformanceCounter () intervals.
So, anyone know a way to get the TSC frequency from the system?