3 package Devel::REPL::Plugin::Timing;
5 our $VERSION = '1.003027';
7 use Devel::REPL::Plugin;
8 use Time::HiRes 'time';
9 use namespace::autoclean;
11 around 'eval' => sub {
13 my ($self, $line) = @_;
19 @ret = $self->$orig($line);
22 $ret[0] = $self->$orig($line);
25 $self->print("Took " . (time - $start) . " seconds.\n");
35 Devel::REPL::Plugin::Timing - display execution times
41 my $repl = Devel::REPL->new;
42 $repl->load_plugin('Timing');
44 # after you run re.pl:
45 $ sum map $_*100, 1..100000;
46 Took 0.0830280780792236 seconds.
53 Shawn M Moore, C<< <sartak at gmail dot com> >>