Re: can I ask question about a bug of gettimeofday here?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Lin George wrote:
I am not sure whether it is the correct place to ask a bug of gettimeofday here.
..
I found sometimes the time will not be increased, but will be decreased. It does not happen each time, but happens rarely.
gettimeofday() is platform dependent, and not a part of gcc. If you want details, you should at least look at the source code for your implementation (e.g. glibc). It is likely that your system hardware has relatively low resolution (e.g. 0.001 sec at best) for the date/time clock, and gettimeofday() has to make some compromise to interpolate, for example by using CPU clock ticks. That would have pitfalls such as variations in clock speed, or discrepancies between your CPUs.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux