eal: reduce timer initialization time
authorZhihong Wang <zhihong.wang@intel.com>
Sun, 22 Nov 2015 19:13:34 +0000 (14:13 -0500)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 21 Jan 2016 14:57:23 +0000 (15:57 +0100)
Changing from 1/2 second to 1/10 doesn't compromise the precision,
and a 4/10 second is worth saving.

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
lib/librte_eal/linuxapp/eal/eal_timer.c

index 9ceff33..6f95d8e 100644 (file)
@@ -271,7 +271,7 @@ get_tsc_freq(void)
 #ifdef CLOCK_MONOTONIC_RAW
 #define NS_PER_SEC 1E9
 
-       struct timespec sleeptime = {.tv_nsec = 5E8 }; /* 1/2 second */
+       struct timespec sleeptime = {.tv_nsec = NS_PER_SEC / 10 }; /* 1/10 second */
 
        struct timespec t_start, t_end;
        uint64_t tsc_hz;