diff options
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2002-10-16 21:32:33 (GMT) |
---|---|---|
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2002-10-16 21:32:33 (GMT) |
commit | d02fedd5aab5d8d6047774a19eb21b27022e693d (patch) | |
tree | b934b0fabaf583fb965ff32a691c375e272c8b10 /plugins/utils.c | |
parent | 71bd3b1d464ebd213731abb28f0648f506541b39 (diff) | |
download | monitoring-plugins-d02fedd5aab5d8d6047774a19eb21b27022e693d.tar.gz |
millisecond timimg where supported
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@125 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/utils.c')
-rw-r--r-- | plugins/utils.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/utils.c b/plugins/utils.c index 05d3f79..0d1729e 100644 --- a/plugins/utils.c +++ b/plugins/utils.c | |||
@@ -317,14 +317,14 @@ is_option (char *str) | |||
317 | 317 | ||
318 | 318 | ||
319 | double | 319 | double |
320 | delta_time (struct timeval *tv) | 320 | delta_time (struct timeval tv) |
321 | { | 321 | { |
322 | struct timeval *pt; | 322 | struct timeval now; |
323 | struct timezone *tz; | 323 | struct timezone tz; |
324 | double et; | ||
324 | 325 | ||
325 | gettimeofday (pt, tz); | 326 | gettimeofday (&now, NULL); |
326 | 327 | return ((double)(now.tv_sec - tv.tv_sec) + (double)(now.tv_usec - tv.tv_usec) / (double)1000000); | |
327 | return (pt->tv_sec - tv->tv_sec + (pt->tv_usec - tv->tv_usec) / 1000000); | ||
328 | } | 328 | } |
329 | 329 | ||
330 | 330 | ||