X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FTimer.pm;fp=perl%2FTimer.pm;h=fc1103159d2150cd3a9468669abfc3f226fc568c;hb=3f58f5ebe86a749d9e1ab37f25b3e7c7255a1906;hp=4a1e1c42e165395145eb913d124bdab2007991b9;hpb=76b23ebfd5384033ecefd8bed4babfeb12d103e9;p=spider.git diff --git a/perl/Timer.pm b/perl/Timer.pm index 4a1e1c42..fc110315 100644 --- a/perl/Timer.pm +++ b/perl/Timer.pm @@ -22,6 +22,8 @@ $BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0)) $main::build += $VERSION; $main::branch += $BRANCH; +my $lasttime = 0; + sub new { my ($pkg, $time, $proc, $recur) = @_; @@ -45,7 +47,9 @@ sub del sub handler { my $now = time; - + + return unless $now != $lasttime; + # handle things on the timer chain my $t; foreach $t (@timerchain) { @@ -54,6 +58,8 @@ sub handler $t->{t} = $now + $t->{interval} if exists $t->{interval}; } } + + $lasttime = $now; } sub DESTROY