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.

It's not.  The function is implemented by whatever C library your
platform provides.  gcc does not include a C library.

Note that mentioning what platform you're using when posting to a
mailing list is always a good idea, otherwise you can only expect
nonspecific answers.  gcc is used on dozens and dozens of platforms, so
you cannot assume we have any idea what you're doing.

> I found sometimes the time will not be increased, but will be decreased. It does not happen each time, but happens rarely.
> 
> Here is my program and output, are there anything wrong.
> 
> Output
> --------------------
> begin second and micro-second is: 1155819609 -- 653911
> print begin time
> 2006-08-17 13:00:09.653
> end second and micro-second is: 1155819609 -- 635116
> print end time
> 2006-08-17 13:00:09.635

I suppose a daemon like ntp (or perhaps the kernel itself) might be
adjusting for clock skew here by periodically subtracting small amounts
of time.

Brian

[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