#!/usr/bin/perl

my $N = 10000;
my $S = "I like pie   pie     pie      pie";
my @strs = qw(fo+ ba*r baz?);
my @pats = map qr/$_/, @strs;

my ($su, $ss) = times;
for (1..$N) {
}
my ($eu, $es) = times;
my ($tu, $ts) = ($eu-$su, $es-$ss);
printf "%12s: %6.2f u %6.2f s %6.2f\n", "STUB", $tu, $ts, $tu+$ts;

my ($su, $ss) = times;
for (1..$N) {
  for (@strs) { $S =~ /$_/ }
}
my ($eu, $es) = times;
my ($tu, $ts) = ($eu-$su, $es-$ss);
printf "%12s: %6.2f u %6.2f s %6.2f\n", "Strings", $tu, $ts, $tu+$ts;

my ($su, $ss) = times;
for (1..$N) {
  for (@pats) { $S =~ /$_/ }
}
my ($eu, $es) = times;
my ($tu, $ts) = ($eu-$su, $es-$ss);
printf "%12s: %6.2f u %6.2f s %6.2f\n", "QRs", $tu, $ts, $tu+$ts;

