my $t = Timer->new(); # ... $t->start(); # ... if ($t->elapsedSeconds() > 5) { ... } # ... $t->stop(); $t->continue(); $t->waitUntilElapsedSeconds(10); $t->start();