mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-06-10 09:10:08 -04:00
add function for elapsed tim ein microseconds
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@670 f882894a-f735-0410-b71e-b25c423dba1c
This commit is contained in:
parent
e7c0f123ae
commit
eb47d0870a
2 changed files with 11 additions and 0 deletions
|
|
@ -287,6 +287,16 @@ delta_time (struct timeval tv)
|
|||
|
||||
|
||||
|
||||
long
|
||||
deltime (struct timeval tv)
|
||||
{
|
||||
struct timeval now;
|
||||
gettimeofday (&now, NULL);
|
||||
return (now.tv_sec - tv.tv_sec)*1000000 + now.tv_usec - tv.tv_usec;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void
|
||||
strip (char *buffer)
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ int gettimeofday(struct timeval *tv, struct timezone *tz);
|
|||
#endif
|
||||
|
||||
double delta_time (struct timeval tv);
|
||||
long deltime (struct timeval tv);
|
||||
|
||||
/* Handle strings safely */
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue