go ahead... be a heretic | |
PerlMonks |
Re: Time Drift when using Win32::Daemon::Simpleby Jenda (Abbot) |
on Apr 17, 2003 at 15:46 UTC ( [id://251239]=note: print w/replies, xml ) | Need Help?? |
No currently there is no way to tell ServiceLoop() to skip a few seconds to get back in sync. The INTERVAL is rather "sleep this long between actions" than "do this action each N minutes". It was easier to do it that way and I did not care that the action doesn't happen once every ten minutes, but once every ten minutes and one second. I will add an option to Win32::Daemon::Simple that will instruct ServiceLoop() to tick in even intervals. Please don't hold your breath. Actually I do have a service that acts as a scheduler and starts different subtasks at different scheduled times (each 30 minutes, at 15:40 each day, at 1:30 each Sunday, etc.) which seems to be close to what you are trying to do. I guess I should extract that functionality into a module. Win32::Daemon::Extended I guess ;-) Anyway for now you will need to do something like this: (I'll probably do something a little more complex for the ServiceLoop() in "exact" mode to decrease the number of time() calls, but I don't think it matters here.) HTH, Jenda Edit by castaway: Closed small tag in signature
In Section
Seekers of Perl Wisdom
|
|