]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
add tvSubS~Dsec()
authorwessels <>
Sat, 15 Nov 1997 12:43:29 +0000 (12:43 +0000)
committerwessels <>
Sat, 15 Nov 1997 12:43:29 +0000 (12:43 +0000)
lib/util.c

index 673e5d3f94ba0ecb3cfb4d5989ca16a9268d1c5d..c90b32bf44c5f6eb14d89cdadee22c2ed79599af 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: util.c,v 1.34 1997/10/25 17:22:31 wessels Exp $
+ * $Id: util.c,v 1.35 1997/11/15 05:43:29 wessels Exp $
  *
  * DEBUG: 
  * AUTHOR: Harvest Derived
@@ -482,6 +482,13 @@ tvSubUsec(struct timeval t1, struct timeval t2)
        (t2.tv_usec - t1.tv_usec);
 }
 
+double
+tvSubDsec(struct timeval t1, struct timeval t2)
+{
+    return (double) (t2.tv_sec - t1.tv_sec) +
+       (double) (t2.tv_usec - t1.tv_usec) / 1000000.0;
+}
+
 /*
  *  xstrncpy() - similar to strncpy(3) but terminates string
  *  always with '\0' if n != 0, and doesn't do padding