From 260e56a381f0005fa590382a178d566e0c405afa Mon Sep 17 00:00:00 2001 From: wessels <> Date: Sat, 15 Nov 1997 12:43:29 +0000 Subject: [PATCH] add tvSubS~Dsec() --- lib/util.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 -- 2.47.2