| Class | Benchmark::Tms |
| In: |
lib/benchmark.rb
|
| Parent: | Object |
A data object, representing the times associated with a benchmark measurement.
| CAPTION | = | " user system total real\n" |
| FMTSTR | = | "%10.6u %10.6y %10.6t %10.6r\n" |
| cstime | [R] | System CPU time of children |
| cutime | [R] | User CPU time of children |
| label | [R] | Label |
| real | [R] | Elapsed real time |
| stime | [R] | System CPU time |
| total | [R] | Total time, that is utime + stime + cutime + cstime |
| utime | [R] | User CPU time |
Returns an initialized Tms object which has u as the user CPU time, s as the system CPU time, cu as the children‘s user CPU time, cs as the children‘s system CPU time, real as the elapsed real time and l as the label.
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 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 fmtstr is not given, FMTSTR is used as default value, detailing the user, system and real elapsed time.
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.
ruby-doc.org is hosted and maintained by James Britt and Happy Camper Studios, a Ruby application development company in Phoenix, Arizona. The site was created in 2002 as part of the Ruby Documentation Project to promote the Ruby language and to help other Ruby hackers.
Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.
For more information on the Ruby programming language, visit ruby-lang.org.
Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.