るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.020秒)

別のキーワード

  1. tms format
  2. tms utime
  3. tms stime
  4. tms cstime
  5. tms cutime

ライブラリ

クラス

モジュール

検索結果

Benchmark::Tms#to_s -> String (117352.0)

引数を省略して Benchmark::Tms#format を呼び出すのと同じです。

引数を省略して Benchmark::Tms#format を呼び出すのと同じです。

Benchmark.#measure(label = "") { ... } -> Benchmark::Tms (388.0)

与えられたブロックを実行して、経過した時間を Process.#times で計り、 Benchmark::Tms オブジェクトを生成して返します。

与えられたブロックを実行して、経過した時間を Process.#times で計り、
Benchmark::Tms オブジェクトを生成して返します。

Benchmark::Tms オブジェクトには to_s が定義されているので、
基本的には以下のように使います。

//emlist[][ruby]{
require 'benchmark'

puts Benchmark::CAPTION
puts Benchmark.measure { "a"*1_000_000 }

#=>
#
# user system total real
# 1.1666...