Well, I looked at that and said to my self, "That would look nicer if the seconds field was just 00." So I tried:bash-2.02$ perl -e '{warn scalar localtime,$/;sleep 60;redo}' Wed Mar 21 10:27:12 2001 Wed Mar 21 10:28:12 2001 Wed Mar 21 10:29:12 2001 ^C
That through me for a bit of a loop, and I thought about it and remembered that sleep is imprecise.bash-2.02$ perl -e 'while(time%60){}{warn scalar localtime,$/;sleep 60 +;redo}' Wed Mar 21 10:39:00 2001 Wed Mar 21 10:39:59 2001 Wed Mar 21 10:40:59 2001 Wed Mar 21 10:41:59 2001 ^C
But what I don't understand, and perhaps someone can enlighten me, is why "top of the second" would round down like that, instead of up. Either I don't understand the phrase, or on some older systems it is just a different behaviour. The system, by the way, is running SunOS 5.7. Also, why didn't it drift before I added the initialization? I thought that maybe the initialization was putting it on the edge, so I added a select statement to pause it for an additional tenth of a second, and ten minutes later it had drifted off again. This leads me to think that the system clock it-self might be at fault. Ideas? Insights?bash-2.02$ perl -e '{while(time%60){}warn scalar localtime,$/;sleep 59 +;redo}' Wed Mar 21 10:58:00 2001 Wed Mar 21 10:59:00 2001 Wed Mar 21 11:00:00 2001 Wed Mar 21 11:01:00 2001 ^C
In reply to Top of the second? by Adam
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |