That's an interesting question... I wonder though if your
redo really qualifies as infinite. A more 'proper' loop use of
redo might be
{ $_++; last if ($_ == 1000); redo }Also, it appears that you don't know (or more likely forgot) about using a negative $count with timethese() -=- you can make Benchmark run the test for x number of seconds by making $count be -x
Check out this excellent post on benchmarking for more ideas: Benchmarking Your Code Also, the perldoc for Benchmark.pm has even more good stuff.