3 package Devel::REPL::Plugin::Timing;
5 use Devel::REPL::Plugin;
6 use Time::HiRes 'time';
7 use namespace::autoclean;
11 my ($self, $line) = @_;
17 @ret = $self->$orig($line);
20 $ret[0] = $self->$orig($line);
23 $self->print("Took " . (time - $start) . " seconds.\n");
33 Devel::REPL::Plugin::Timing - display execution times
39 my $repl = Devel::REPL->new;
40 $repl->load_plugin('Timing');
42 # after you run re.pl:
43 $ sum map $_*100, 1..100000;
44 Took 0.0830280780792236 seconds.
51 Shawn M Moore, C<< <sartak at gmail dot com> >>