A data object, representing the times associated with a benchmark measurement.

Constants

Default caption, see also Benchmark::CAPTION

Default format string, see also Benchmark::FORMAT

Attributes
Read

User CPU time

Read

System CPU time

Read

User CPU time of children

Read

System CPU time of children

Read

Elapsed real time

Read

Total time, that is utime + stime + cutime + cstime

Read

Label

Class Methods

Returns an initialized Tms object which has utime as the user CPU time, stime as the system CPU time, cutime as the children’s user CPU time, cstime as the children’s system CPU time, real as the elapsed real time and label as the label.

Instance Methods

Returns a new Tms object obtained by memberwise multiplication of the individual times for this Tms object by x.

Returns a new Tms object obtained by memberwise summation of the individual times for this Tms object with those of the other Tms object. This method and /() are useful for taking statistics.

Returns a new Tms object obtained by memberwise subtraction of the individual times for the other Tms object from those of this Tms object.

Returns a new Tms object obtained by memberwise division of the individual times for this Tms object by x. This method and +() are useful for taking statistics.

Returns a new Tms object whose times are the sum of the times for this Tms object, plus the time required to execute the code block (blk).

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).

Returns the contents of this Tms object as a formatted string, according to a format string like that passed to Kernel.format. In addition, format accepts the following extensions:

%u

Replaced by the user CPU time, as reported by Tms#utime.

%y

Replaced by the system CPU time, as reported by stime (Mnemonic: y of “s*y*stem”)

%U

Replaced by the children’s user CPU time, as reported by Tms#cutime

%Y

Replaced by the children’s system CPU time, as reported by Tms#cstime

%t

Replaced by the total CPU time, as reported by Tms#total

%r

Replaced by the elapsed real time, as reported by Tms#real

%n

Replaced by the label string, as reported by Tms#label (Mnemonic: n of “*n*ame”)

If format is not given, FORMAT is used as default value, detailing the user, system and real elapsed time.

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 (x).

op can be a mathematical operation such as +, -, *, /

Returns a new 6-element array, consisting of the label, user CPU time, system CPU time, children’s user CPU time, children’s system CPU time and elapsed real time.

Returns a hash containing the same data as ‘to_a`.

Same as format.