summaryrefslogtreecommitdiff
path: root/lib/benchmark.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-15 12:45:46 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-15 12:45:46 +0000
commit97f8d0fb9e620e5219320803a6da65a544e115ec (patch)
treef45af83ae36c9f6cbc35bc24676f102ca528ee3a /lib/benchmark.rb
parent0d7facee426bc2a990da6a8210fe98b80c4226e9 (diff)
Work on Benchmark::Tms documentation [ci skip]
[ruby-core:88874] [Bug #15080] From: Richard Wardin <shalmezad@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/benchmark.rb')
-rw-r--r--lib/benchmark.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/benchmark.rb b/lib/benchmark.rb
index 8d768b631e..5ce9710586 100644
--- a/lib/benchmark.rb
+++ b/lib/benchmark.rb
@@ -439,6 +439,9 @@ module Benchmark
#
# An in-place version of #add.
+ # Changes the times of this Tms object by making it the sum of the times
+ # for this Tms object, plus the time required to execute
+ # the code block (+blk+).
#
def add!(&blk)
t = Benchmark.measure(&blk)
@@ -452,7 +455,7 @@ module Benchmark
#
# Returns a new Tms object obtained by memberwise summation
- # of the individual times for this Tms object with those of the other
+ # of the individual times for this Tms object with those of the +other+
# Tms object.
# This method and #/() are useful for taking statistics.
#
@@ -460,20 +463,20 @@ module Benchmark
#
# Returns a new Tms object obtained by memberwise subtraction
- # of the individual times for the other Tms object from those of this
+ # of the individual times for the +other+ Tms object from those of this
# Tms object.
#
def -(other); memberwise(:-, other) end
#
# Returns a new Tms object obtained by memberwise multiplication
- # of the individual times for this Tms object by _x_.
+ # of the individual times for this Tms object by +x+.
#
def *(x); memberwise(:*, x) end
#
# Returns a new Tms object obtained by memberwise division
- # of the individual times for this Tms object by _x_.
+ # of the individual times for this Tms object by +x+.
# This method and #+() are useful for taking statistics.
#
def /(x); memberwise(:/, x) end
@@ -529,7 +532,7 @@ module Benchmark
#
# Returns a new Tms object obtained by memberwise operation +op+
# of the individual times for this Tms object with those of the other
- # Tms object.
+ # Tms object (+x+).
#
# +op+ can be a mathematical operation such as <tt>+</tt>, <tt>-</tt>,
# <tt>*</tt>, <tt>/</tt>