From 6f2f78ce0e63f8d0afcde6c0f2bbf0e9079fd323 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 5 Jan 2007 11:44:49 +0000 Subject: [PATCH] Special value -1.0 means 'could not get timings' on current platform. --- src/timing.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/timing.c b/src/timing.c index 6957bc9..31f1095 100644 --- a/src/timing.c +++ b/src/timing.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: timing.c,v 1.1 2007-01-03 13:46:18 adam Exp $ + * $Id: timing.c,v 1.2 2007-01-05 11:44:49 adam Exp $ */ /** @@ -48,20 +48,22 @@ void yaz_timing_start(yaz_timing_t t) { #if HAVE_SYS_TIMES_H times(&t->tms1); + t->user_sec = 0.0; + t->sys_sec = 0.0; +#else + t->user_sec = -1.0; + t->sys_sec = -1.0; #endif #if HAVE_SYS_TIME_H gettimeofday(&t->start_time, 0); -#endif + t->real_sec = 0.0; +#else t->real_sec = -1.0; - t->user_sec = -1.0; - t->sys_sec = -1.0; +#endif } void yaz_timing_stop(yaz_timing_t t) { - t->real_sec = 0.0; - t->user_sec = 0.0; - t->sys_sec = 0.0; #if HAVE_SYS_TIMES_H times(&t->tms2); -- 1.7.10.4