projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add standard gcommit command
[spider.git]
/
perl
/
Timer.pm
diff --git
a/perl/Timer.pm
b/perl/Timer.pm
index 98132dec6578345a4b955b02af7eae67e5296377..60ef387717f74700569c72efcb3a88b6f3e2932a 100644
(file)
--- a/
perl/Timer.pm
+++ b/
perl/Timer.pm
@@
-10,17
+10,13
@@
package Timer;
package Timer;
-use vars qw(@timerchain $notimers);
+use vars qw(@timerchain $notimers
$lasttime
);
use DXDebug;
@timerchain = ();
$notimers = 0;
use DXDebug;
@timerchain = ();
$notimers = 0;
-use vars qw($VERSION $BRANCH);
-$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
-$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ ) || 0;
-$main::build += $VERSION;
-$main::branch += $BRANCH;
+$lasttime = 0;
sub new
{
sub new
{
@@
-45,7
+41,9
@@
sub del
sub handler
{
my $now = time;
sub handler
{
my $now = time;
-
+
+ return unless $now != $lasttime;
+
# handle things on the timer chain
my $t;
foreach $t (@timerchain) {
# handle things on the timer chain
my $t;
foreach $t (@timerchain) {
@@
-54,6
+52,8
@@
sub handler
$t->{t} = $now + $t->{interval} if exists $t->{interval};
}
}
$t->{t} = $now + $t->{interval} if exists $t->{interval};
}
}
+
+ $lasttime = $now;
}
sub DESTROY
}
sub DESTROY