summaryrefslogtreecommitdiff
path: root/lib/Benchmark.pm
diff options
context:
space:
mode:
authorNeil Bowers <neil@bowers.com>2013-06-26 22:53:55 +0100
committerFather Chrysostomos <sprout@cpan.org>2013-06-28 06:16:38 -0700
commit394f432921d9bb404d9bf51fedd4716b2f2e6d87 (patch)
tree50fc6e72a0416ffd375d5f985bf30e3b09384c7d /lib/Benchmark.pm
parent38d27505c65e77f92cb8e231db1ac56a3dee8f57 (diff)
downloadperl-394f432921d9bb404d9bf51fedd4716b2f2e6d87.tar.gz
7b2d3c0 Added description of the Benchmark object to doc
Diffstat (limited to 'lib/Benchmark.pm')
-rw-r--r--lib/Benchmark.pm40
1 files changed, 40 insertions, 0 deletions
diff --git a/lib/Benchmark.pm b/lib/Benchmark.pm
index 3d39120c3f..e153435555 100644
--- a/lib/Benchmark.pm
+++ b/lib/Benchmark.pm
@@ -292,6 +292,46 @@ wallclock time to be measured in microseconds, instead of integer
seconds. Note though that the speed computations are still conducted
in CPU time, not wallclock time.
+=head1 Benchmark Object
+
+Many of the functions in this module return a Benchmark object,
+or in the case of C<timethese()>, a reference to a hash, the values of
+which are Benchmark objects. This is useful if you want to store or
+further process results from Benchmark functions.
+
+Internally the Benchmark object holds timing values,
+described in L</"NOTES"> below.
+The following methods can be used to access them:
+
+=over 4
+
+=item cpu_p
+
+Total CPU (User + System) of the main (parent) process.
+
+=item cpu_c
+
+Total CPU (User + System) of any children processes.
+
+=item cpu_a
+
+Total CPU of parent and any children processes.
+
+=item real
+
+Real elapsed time "wallclock seconds".
+
+=item iters
+
+Number of iterations run.
+
+=back
+
+The following illustrates use of the Benchmark object:
+
+ $result = timethis(100000, sub { ... });
+ print "total CPU = ", $result->cpu_a, "\n";
+
=head1 NOTES
The data is stored as a list of values from the time and times