Tweaks to constant.pm
[p5sagit/p5-mst-13.2.git] / lib / Benchmark.pm
index c749116..a3c8544 100644 (file)
@@ -14,8 +14,15 @@ timeit - run a chunk of code and see how long it goes
 
     timethis ($count, "code");
 
+    # Use Perl code in strings...
     timethese($count, {
        'Name1' => '...code1...',
+       'Name2' => '...code2...',
+    });
+
+    # ... or use subroutine references.
+    timethese($count, {
+       'Name1' => sub { ...code1... },
        'Name2' => sub { ...code2... },
     });