in reply to getting at benchmarking data
A little digging in Benchmark.pm shows that the values are returned as an array so you can:
use strict; use warnings; use Benchmark qw(timethis cmpthese); my $str = 'The quick brown fox ' x 100; my $t = timethis (1000, sub {testSub ($str)}); print "\n@$t\n"; sub testSub { my $str = shift; my @matches = $str =~ /(\b.(?!ox))/g; }
Prints:
timethis 1000: 3 wallclock secs ( 2.38 usr + 0.00 sys = 2.38 CPU) @ + 421.05/s (n=1000) 3 2.375 0 0 0 1000
|
|---|