Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: system-clock-safe timers without time()?by tachyon (Chancellor) |
on Apr 13, 2003 at 13:12 UTC ( [id://250133]=note: print w/replies, xml ) | Need Help?? |
Why not just teach your server admin(s) to sync their clocks using NTP? Then you don't have a problem..... As to the approach I would probably run a demon that just did:
In this approach we allow use 5 seconds of change in 10 minutes as our significance level. If the time has changed by more than this then someone has probably changed the clock so we write the offset to the offset file.... This is the general approach used by time limited software for instance that gets upset if you change the clock. Just check the offset file as needed. This should be less load and is not dependent on sleep(1) being exactly 1,000 msec. If it is not your clock will drift considerably over time. cheers tachyon s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
In Section
Seekers of Perl Wisdom
|
|