Help for this page

Select Code to Download


  1. or download this
    use strict;
    use Benchmark qw(cmpthese);
    ...
      'i'       => sub { $text =~ /abc/ig },
      'chars'   => sub { $text =~ /[Aa][Bb][Cc]/g },
    });
    
  2. or download this
    Benchmark: timing 10 iterations of chars, i...
         chars: 40 wallclock secs (38.37 usr +  0.04 sys = 38.41 CPU) @  0
    +.26/s (n=10)
    ...
          s/iter chars     i
    chars   3.84    --  -70%
    i       1.14  236%    --