I have determined that there is a definite bug in the Event module. 
I have a fairly involved newsgroup reading application that I
recently converted to using the Event module.  One of the timers is
supposed to report the applications progress every 15 minutes on the
quarter hour. 

my $now = time();
my $prog_timer = Event->timer('at' => ($now + 900) - ($now % 900),
                              'interval' => 900,
                              'hard'     => 1,
                              'cb'       => \&Progress);

However, as the program runs, these reports keep getting
(cumulatively) later past the quarter hour.  When I put debug
statements in the application to report the state of the reporting
watcher, it shows that the time ('at' attribute) is correctly set to
the quarter hour.

I've tried to go through the code to find the source of the
discrepency, but haven't found where the problem lies yet.  I suspect
that the module tries to keep track of time on its own without
checking against the system clock.  As a result, small errors slowly
accumulate causing events to be triggered later and later.  (For me,
this error is accumulating at a rate of about 3 seconds every 15
minutes of operation.)
=====
Jerry D. Hedden
<< If you're not having fun, then you're not doing it right! >>

Reply via email to