On Wed, 19 Jan 2000, Sabrina Minshall wrote:
>What's going one here? Successive calls to gettimeofday
>yields negative elapsed time?
>
>Any fixes?
>
[ code snipped ]
Well, the PR considers a different problem. What your code does is call
gettimeofday() once, record the value, and then a little later, call it
again while proceeding to calculate a delta between the latter and
previous results. Notice the issue mentionned in the PR has been
concluded to be faulty hardware.
Now, I assure you, this is a problem with your code snippet. I tried this
code on a DEC box running:
OSF1 oracle.dsuper.net V4.0 1091 alpha
And got the exact same results.
The problem is the tv1 = tv2 structure equality. Since the byte order is
different, you get your usec from tv1 ending up in tv2's usec field.
Regards,
Bosko.
--
Bosko Milekic
Email: [EMAIL PROTECTED]
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message