On 04/02/2014 02:28 PM, Mattias Gaertner wrote:
On Wed, 02 Apr 2014 14:01:26 +0200
zeljko <zel...@holobit.net> wrote:

[...]
My guess is that there no need to speculate what most programs need but
what is more precise or better to say what is correct.

They measure different things. The precision depends on what you
expect.


IMO CLOCK_MONOTONIC is affected by eg. ntp/adjtime() so result of
GetTickCount() is not correct in all cases.
Imagine daemon service which relies on GetTickCount and then clock
change due to the daylight via

Sigh. Again: CLOCK_MONOTONIC is monotonic. It does not go
backwards and especially it does not apply timezone, daylight or user
time changes. It only fixes shortcomings of the machine counters.

See for example here:
http://man7.org/linux/man-pages/man2/clock_gettime.2.html

Do we read same man page ?

CLOCK_MONOTONIC
              Clock that cannot be set and represents monotonic time
              since some unspecified starting point.  This clock is
              not affected by discontinuous jumps in the system time
              (e.g., if the system administrator manually changes the
              clock), *but is affected by the incremental adjustments
              performed by adjtime(3) and NTP*.

CLOCK_MONOTONIC_RAW (since Linux 2.6.28; Linux-specific)
              Similar to CLOCK_MONOTONIC, but provides access to a
              raw hardware-based time that *is not subject to NTP
              adjustments or the incremental adjustments performed by
              adjtime(3)*.

zeljko





--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to