From d22e62f989dd16d503d5430ffe6f55075139e057 Mon Sep 17 00:00:00 2001 From: Arlin Davis Date: Tue, 2 Oct 2007 11:43:34 -0700 Subject: [PATCH] Change DT_Mdep_GetTime to use gettimeofday() which has more resolution than times(). Signed-off-by: Anton Blanchard --- test/dapltest/mdep/linux/dapl_mdep_user.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/dapltest/mdep/linux/dapl_mdep_user.c b/test/dapltest/mdep/linux/dapl_mdep_user.c index 91e45b9..491ead1 100644 --- a/test/dapltest/mdep/linux/dapl_mdep_user.c +++ b/test/dapltest/mdep/linux/dapl_mdep_user.c @@ -176,9 +176,9 @@ DT_Mdep_GetCpuStat ( unsigned long DT_Mdep_GetTime (void) { - struct tms ts; - clock_t t = times (&ts); - return (unsigned long) ((DAT_UINT64) t * 1000 / CLOCKS_PER_SEC); + struct timeval tv; + gettimeofday(&tv, NULL); + return tv.tv_sec * 1000 + tv.tv_usec / 1000; } double -- 2.41.0