In message , NY
writes
>When you say running
>
>date +%H%M
>and
>date
>
>from the command line, do you mean that once the sensor has changed
>state and your script has logged this, the clock is permanently a few
>minutes seconds fast?
>
Running date +%H%M from within the script always produces the correct
time. I've run tail -f on the log file, and that is always correct.
Running date (with no arguments) from the script is giving the odd
results, with the time part of the output being anything up to 9 minutes
late (I've spotted an entry from today where it is right).
However whenever I run those commands from the command line (rather than
from the script) they always return the right answer.
>What's the significance of the "0630 / ---------- / thread started" at
>the beginning of each block - how are you generating that timestamp?
>
>
The script is generating the timestamp (date +%H%M), the sensor status
info is taken by parsing the output of the python code that checks the
sensor status, and from that output I can tell whether or not the sensor
state (which is Boolean) has changed.
>I could understand it if the clock was slow, as something could be
>"stealing" timer ticks, but running fast is more difficult to explain.
>
The thing is, that those two executions of date are at best a second or
so apart, and by the time cron fires again a minute later, the clock is
correct again.
>Once the sensor has changed state and the date command returns the
>wrong time, what happens if the sensor triggers again? Does the date
>command show an even bigger (double?) discrepancy from real time, or is
>it the always wrong by the same time. In other words, is the difference
>between sensor-changed times then the same as the interval as timed by
>reference to an external clock.
>
No. The time (date +%H%M) remains correct, but the full timestamp (date
no arguments) can be anything from 0 to 9 minutes out, and one state
change can give a different discrepancy to the other. So the period of
time between sensor state changes is likely to be +/- 9 minutes of the
actual period, this is not consistent either.
Adrian
--
To Reply :
replace "bulleid" with "adrian" - all mail to bulleid is rejected
Sorry for the rigmarole, If I want spam, I'll go to the shops
Every time someone says "I don't believe in trolls", another one dies.
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|