Comment by robocat
2 days ago
For a low precision environment to avoid sudden jumps I used SetSystemTimeAdjustment on Windows (now SetSystemTimeAdjustmentPrecise) to smoothly steer the system clock to match the GPS supplied time signal.
On Linux I think the adjtimex() system call does the equivalent https://manpages.ubuntu.com/manpages/trusty/man2/adjtimex.2....
It smears out time differences which is great for some situations and less ideal for others.
Also I implemented a simple PID controller that could automatically compensate against some types of internal clock drift.
Worked really well for the project.
Avoiding time jumps was really worthwhile.