clockspeed patch to use struct timespec timers

"Chris K. Young" <[email protected]> 27 Feb 2003 03:16:36 +1300
Newsgroups gmane.comp.lib.libtai
Message-ID <[email protected]>
As a diversion to the usual posts about 22-second discrepancies and
(in the most-recent thread) signed integer promotions, I thought I'd
post something on-topic, and hopefully interesting.

As the reader may know, all the DJB time functions use the BSD-style
struct timeval interfaces (gettimeofday, &c). Just for fun, I decided
to hack a version to use the POSIX-style struct timespec interfaces
(clock_gettime, &c) instead.

Of course, the exercise is completely academic, as few computers seem
to have the timer resolution necessary for such high-precision timers
to make any practical difference.

At http://cloud9.hedgee.com/priv/clockspeed.diff I've posted a patch
to clockspeed-0.62 that converts nearly all uses of struct timeval to
use struct timespec instead. It's been tested on FreeBSD 4.7.

Enjoy,
	---Chris K.
-- 
 Chris, the Young One |_ Consider it a greater risk to expect things not to
  Auckland, New Zealand |_ work, than it is to expect things to work...
http://cloud9.hedgee.com/ |_ ---Bobby