strange bug in gettimeofday function

Andrew Makhorin mao@gnu.org
Sun Feb 11 16:22:00 GMT 2007


Hi,

I detected a strange bug in the standard function gettimeofday.
It *sometimes* reports the time which being expressed as the integer
number of milliseconds is *less* than the time obtained *earlier* with
the same function.

The expression 1000000 * tv.tv_sec + tv.tv_usec is calculated in
64-bit arithmetic, so overflow cannot happen. The negative difference
in the time values on two successive calls is about 100 milliseconds.

cygcheck.out is attached.

Andrew Makhorin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 7886 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20070211/794c562b/attachment.obj>
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list