Thread (67 messages) 67 messages, 9 authors, 2021-04-21

Re: [dpdk-dev] [PATCH 1/6] eal: add internal API for current time

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;
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help