[Nagiosplug-checkins] CVS: nagiosplug/plugins utils.c,1.29,1.30 utils.h,1.13,1.14

Karl DeBisschop kdebisschop at users.sourceforge.net
Fri Aug 8 21:13:03 CEST 2003


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs1:/tmp/cvs-serv27405

Modified Files:
	utils.c utils.h 
Log Message:
add function for elapsed tim ein microseconds

Index: utils.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/utils.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -r1.29 -r1.30
*** utils.c	9 Aug 2003 00:41:06 -0000	1.29
--- utils.c	9 Aug 2003 04:12:14 -0000	1.30
***************
*** 288,291 ****
--- 288,301 ----
  
  
+ 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

Index: utils.h
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/utils.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** utils.h	9 Aug 2003 00:41:06 -0000	1.13
--- utils.h	9 Aug 2003 04:12:14 -0000	1.14
***************
*** 60,63 ****
--- 60,64 ----
  
  double delta_time (struct timeval tv);
+ long deltime (struct timeval tv);
  
  /* Handle strings safely */





More information about the Commits mailing list