diff options
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2002-10-16 04:56:19 +0000 |
---|---|---|
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2002-10-16 04:56:19 +0000 |
commit | 6cbf1dd4a321ced6dffa5ca590692d283731f987 (patch) | |
tree | 80abc79978b6894c786ecb27e48a00f429df3027 /plugins/utils.c | |
parent | 509f71f79e62c52299ab61820c70726bc3a8f9cb (diff) | |
download | monitoring-plugins-6cbf1dd4a321ced6dffa5ca590692d283731f987.tar.gz |
start support for gettimeofday and tv_usec
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@116 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/utils.c')
-rw-r--r-- | plugins/utils.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/utils.c b/plugins/utils.c index d97ad480..6e52dab7 100644 --- a/plugins/utils.c +++ b/plugins/utils.c @@ -316,6 +316,19 @@ is_option (char *str) +double +delta_time (struct timeval *tv) +{ + struct timeval *pt; + struct timezone *tz; + + gettimeofday (pt, tz); + + return (pt->tv_sec - tv->tv_sec + (pt->tv_usec - tv->tv_usec) / 1000000); +} + + + void strip (char *buffer) |