3 package Devel::REPL::Plugin::Timing;
4 # ABSTRACT: Display execution times
6 our $VERSION = '1.003029';
8 use Devel::REPL::Plugin;
9 use Time::HiRes 'time';
10 use namespace::autoclean;
12 around 'eval' => sub {
14 my ($self, $line) = @_;
20 @ret = $self->$orig($line);
23 $ret[0] = $self->$orig($line);
26 $self->print("Took " . (time - $start) . " seconds.\n");
40 my $repl = Devel::REPL->new;
41 $repl->load_plugin('Timing');
43 # after you run re.pl:
44 $ sum map $_*100, 1..100000;
45 Took 0.0830280780792236 seconds.
52 Shawn M Moore, C<< <sartak at gmail dot com> >>