# regextiming2.pl #!C:/perl/bin -w use strict; use Time::HiRes 'time'; # regextiming2.pl use vars qw( $string $start $start2 $end $end2 ); $string = "fred and barney went bowling last night"; { $start = time(); if ( $string =~ /fred.+barney/) { } else { print "No match\n\n"; } $end = time(); print "This match used ",$end - $start, " as measured by Time::HiRes on a w2k box\n\n"; } { $start2 = time(); if ( $string =~ /fred.+barney/) { } else { print "No match\n\n"; } $end2 = time(); print "The second match used ",$end2 - $start2, " as measured by Time::HiRes on a w2k box\n\n"; }