Analyzing some log files of an “24/7”-application, I found a strange time jump:
date time counter
...
20200928 184015 893872
20200928 184016 893873
20200928 184016 893874
20200928 184016 893875
20200928 184016 893876
20200928 184016 893877
20200928 184016 893878
20200928 184016 893879
20200928 183916 893880
20200928 183916 893881
20200928 183916 893882
20200928 183916 893883
20200928 183916 893884
20200928 183916 893885
20200928 183917 893886
...
The time is the windows system time. The counter increments about every 100ms (typically +/- 15ms), so to 12 increments are typical, but just 7 or 6 counts are still “OK”. But I expected the line with counter 893880
to be taken at 184016
or 184017
but not at 183916
, 61 or 60 seconds before.
What could be reasons for this 61 seconds system time jump backwards?
I suspect the following:
- Windows stets its system time to UEFI time at boot. If the system is not rebooted for weeks/months/years, both times can drift apart significantly.
- During operation, windows measures the difference between system time and UEFI time. If the measured difference is more than a minute, windows sets its system time to whatever the current UEFI time is.
Can someone confirm this behavior? And is it possible to change this threshold to e.g. 1 second, so that it will not mess up my time stamps in the future.
Background info:
- The app is intended to run 24/7, but can crash. Another program takes care of automatically restarting my application after it crashed (counter starts at 1 again).
- The machine will be rebooted by an external watchdog under certain circumstances (e.g., too many application crashes, windows crashed, etc). I can tell that the last app restart was 24.8 h before the time jump. This does not necessarily mean that the machine was rebooted, I cannot tell when the last machine reboot was.
- the machine is not connected to any network (no time server), time is not manually synced/set, CMOS battery is still in a good state.
- The machine is an industrial computer (Siemens SIMATIC IPC227E), no dual boot.