I was using the core function "time" and noticed that the unixtime stamp would skip a second just before the event would occur.
Then I tried to see more with Time::HiRes and saw that a second would be skipped when the decimal turned over.
I ran these two lines of code concurrently in bash shells, and saw the strange results:
perl -le 'while () { print time; sleep 1 }'
1579941920
1579941921
1579941922
1579941924 <- WTF?
perl -MTime::HiRes=time -le 'while () { print time; sleep 1 }'
1579941920.99577
1579941921.99751
1579941922.99824
1579941924.00213 <- WTF!
A third terminal running at the same time printed the missing
second, but, it skipped one when it eventually turned over.
1579941920.51386 1579941921.51823 1579941922.52046 1579941923.52163 <- OK 1579941924.52477The interval does not seem significant:
1579941920.99577 1.00174 1579941921.99751 1.00073 1579941922.99824 1.00389 1579941924.00213 <- WTF!I tried a lot of things like disabling NTP and using usleep but it always skips and causes my program to flip out for a second. What is this sorcery? Thanx
In reply to missing second of time by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |