Re: [dpdk-dev] [PATCH 1/6] eal: add internal API for current time
From: Nick Connolly <hidden>
Date: 2021-03-01 22:31:41
From: Nick Connolly <hidden>
Date: 2021-03-01 22:31:41
Calculation of usec value is incorrect - 'ticks' is not adjusted for epoch, whereas 'sec' has been, also subtraction has mismatched units - ticks in 100ns and sec * USEC_PER_SEC in usecs. On 14/02/2021 01:20, Dmitry Kozlyuk wrote:
+ GetSystemTimePreciseAsFileTime(&ft); + ticks = ((uint64_t)ft.dwHighDateTime << 32) | ft.dwLowDateTime; + sec = (ticks - EPOCH) / (TICKS_PER_USEC * USEC_PER_SEC); + now->sec = sec; + now->usec = (ticks - sec * USEC_PER_SEC) / TICKS_PER_USEC;