From d02fedd5aab5d8d6047774a19eb21b27022e693d Mon Sep 17 00:00:00 2001 From: Karl DeBisschop Date: Wed, 16 Oct 2002 21:32:33 +0000 Subject: millisecond timimg where supported git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@125 f882894a-f735-0410-b71e-b25c423dba1c --- plugins/utils.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins/utils.c') diff --git a/plugins/utils.c b/plugins/utils.c index 05d3f797..0d1729e0 100644 --- a/plugins/utils.c +++ b/plugins/utils.c @@ -317,14 +317,14 @@ is_option (char *str) double -delta_time (struct timeval *tv) +delta_time (struct timeval tv) { - struct timeval *pt; - struct timezone *tz; + struct timeval now; + struct timezone tz; + double et; - gettimeofday (pt, tz); - - return (pt->tv_sec - tv->tv_sec + (pt->tv_usec - tv->tv_usec) / 1000000); + gettimeofday (&now, NULL); + return ((double)(now.tv_sec - tv.tv_sec) + (double)(now.tv_usec - tv.tv_usec) / (double)1000000); } -- cgit v1.2.3