Re: advice on how to detect time change



d_cymbal@xxxxxxxxxxx wrote:
Perhaps I didn't phrase that question correctly. My application
doesn't care what the system time is, or care that it is correct, but
it does need to detect if some external entity changes the time out
from under it (this is a master device which must globally update
slave devices with a time change if the user (or some other force such
as ntp) changes the time on the master system. The process itself
doesn't rely on or care what the system time is, it just needs to
detect changes.

There is a design error in your application. It is trying to measure
intervals by subtracting time values. This cannot work reliably
ANY system, not just Linux. The time is the closest known approximation
to the value of some counter at your [government] Standards facility.
Both the approximation and the "knowing" are subject to error and
correction, and by calling time() you have agreed to these foibles.
If you want to measure intervals, then get your own crystal-controlled
oscillator and counter.

--


.



Relevant Pages