[dpdk-dev] [PATCH 2/2] timer: support EAL functions on Windows
Dmitry Kozlyuk
dmitry.kozliuk at gmail.com
Fri Apr 24 23:32:02 CEST 2020
On 2020-04-23 17:43 GMT+0300 Fady Bader wrote:
> +uint64_t
> +get_tsc_freq(void)
> +{
> + uint64_t tsc_freq;
> + LARGE_INTEGER Frequency;
> +
> + QueryPerformanceFrequency(&Frequency);
> + /*
> + QueryPerformanceFrequency output is in khz.
> + Mulitply by 1K to obtain the true frequency of the CPU (khz -> hz)
> + */
> + tsc_freq = ((uint64_t)Frequency.QuadPart * 1000);
> +
> + return tsc_freq;
> +}
QueryPerformanceFrequency() output is in Hz of TSC, not CPU clock. To get
real time interval from TSC difference, we divide that difference to TSC
frequency with no additional 1000 multiplier.
P.S. Fixed my address in Cc.
--
Dmitry Kozlyuk
More information about the dev
mailing list