by nonrandomstring · 1y ago · 0 comments
* Okay, you have a little control in that you can press enter, or otherwise set it running, at a particular moment.
while true; do date +%s%N; doneI have a program I use in shell scripting called sleepuntil that does something like this, but it doesn't try to be millisecond-accurate.
So I figured you need a time "diff", a single command that updates from both timeservers and then presents the offset in a single operation. So (I just researched this again and) there's three answers here [0], using ntpdate and something I've never seen before called clockdiff.
[0] https://stackoverflow.com/questions/2296981/how-can-i-work-o...