From f459d2320bf82d82bc4efd6dcbfc73b607d462ea Mon Sep 17 00:00:00 2001 From: Zhihong Wang Date: Sun, 22 Nov 2015 14:13:34 -0500 Subject: [PATCH] eal: reduce timer initialization time 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 --- lib/librte_eal/linuxapp/eal/eal_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eal/linuxapp/eal/eal_timer.c b/lib/librte_eal/linuxapp/eal/eal_timer.c index 9ceff3301b..6f95d8e21d 100644 --- a/lib/librte_eal/linuxapp/eal/eal_timer.c +++ b/lib/librte_eal/linuxapp/eal/eal_timer.c @@ -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; -- 2.20.1