1 package Devel::REPL::Plugin::Timing;
3 use Devel::REPL::Plugin;
4 use Time::HiRes 'time';
5 use namespace::autoclean;
9 my ($self, $line) = @_;
15 @ret = $self->$orig($line);
18 $ret[0] = $self->$orig($line);
21 $self->print("Took " . (time - $start) . " seconds.\n");
31 Devel::REPL::Plugin::Timing - display execution times
37 my $repl = Devel::REPL->new;
38 $repl->load_plugin('Timing');
40 # after you run re.pl:
41 $ sum map $_*100, 1..100000;
42 Took 0.0830280780792236 seconds.
49 Shawn M Moore, C<< <sartak at gmail dot com> >>