Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Jan 2000 21:43:58 -0500 (EST)
From:      Bosko Milekic <bmilekic@dsuper.net>
To:        Sabrina Minshall <sabrina@accesscom.com>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: PR kern/14034: gettimeofday() returns negative value?
Message-ID:  <Pine.OSF.4.05.10001192109240.17815-100000@oracle.dsuper.net>
In-Reply-To: <200001200141.RAA30336@shell.accesscom.com>

next in thread | previous in thread | raw e-mail | index | archive | help

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:  bmilekic@dsuper.net




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.OSF.4.05.10001192109240.17815-100000>