From: wessels <> Date: Sat, 15 Nov 1997 12:43:29 +0000 (+0000) Subject: add tvSubS~Dsec() X-Git-Tag: SQUID_3_0_PRE1~4526 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=260e56a381f0005fa590382a178d566e0c405afa;p=thirdparty%2Fsquid.git add tvSubS~Dsec() --- diff --git a/lib/util.c b/lib/util.c index 673e5d3f94..c90b32bf44 100644 --- a/lib/util.c +++ b/lib/util.c @@ -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