Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Nov 1996 06:30:02 -0800 (PST)
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-bugs
Subject:   Re: misc/2007: /usr/include/sys lacking timer arithmetic functions..
Message-ID:  <199611141430.GAA11958@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR misc/2007; it has been noted by GNATS.

From: Bruce Evans <bde@zeta.org.au>
To: ccsanady@friley216.res.iastate.edu, FreeBSD-gnats-submit@FreeBSD.org
Cc:  Subject: Re: misc/2007: /usr/include/sys lacking timer arithmetic functions..
Date: Fri, 15 Nov 1996 01:23:00 +1100

 >It would be nice if there were more timer arithmetic functions in sys/time.h.
 >The following is a patch from the relevent portion which I have taken from
 >NetBSD's.
 
 s/nice/nasty/
 
 Applications got along for years without these functions, so why add them
 now that floating point is faster than timeval arithmetic on most machines,
 64-bit machines are becoming available, and 64 bit long longs are available?
 I usually use the following timeval arithmetic functions:
 
 	timeval difference -> double
 		((tv2.tv_sec - tv1.tv_sec) + (tv2.tv_usec - tv1.tv_sec) * 1e-6)
 	timeval -> double
 		(tv1.tv_sec + tv1.tv_sec * 1e-6)
 
 Why not add these, and more functions for 64 bit longs, and more for 64 bit
 long longs...?  Pretty soon you'll need C++ to manage them all :-).
 
 Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199611141430.GAA11958>