From: Jarkko Hietaniemi Date: Fri, 19 Mar 1999 21:12:14 +0000 (+0000) Subject: Describe the new Benchmark feature in more detail. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=155776c0c7f8e2be3290142fa6f544bce470abdb;p=p5sagit%2Fp5-mst-13.2.git Describe the new Benchmark feature in more detail. p4raw-id: //depot/cfgperl@3122 --- diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 589a5ce..e017fed 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -291,7 +291,21 @@ Added Dumpvalue module provides screen dumps of Perl data. =item Benchmark You can now run tests for I seconds instead of guessing the right -number of tests to run. +number of tests to run: e.g. timethese(-5, ...) will run each of the +codes for at least 5 CPU seconds. Zero as the "number of repetitions" +means "for at least 3 CPU seconds". The output format has also +changed. For example: + +use Benchmark;$x=3;timethese(-5,{a=>sub{$x*$x},b=>sub{$x**2}}) + +will now output something like this: + +Benchmark: running a, b, each for at least 5 CPU seconds... + a: 5 wallclock secs ( 5.77 usr + 0.00 sys = 5.77 CPU) @ 200551.91/s (n=1156516) + b: 4 wallclock secs ( 5.00 usr + 0.02 sys = 5.02 CPU) @ 159605.18/s (n=800686) + +New features: "each for at least N CPU seconds...", "wallclock secs", +and the "@ operations/CPU second (n=operations)". =item Fcntl