るりまサーチ

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

別のキーワード

  1. open3 popen2e
  2. socket af_e164
  3. matrix rank_e
  4. matrix det_e
  5. open3 capture2e

ライブラリ

検索結果

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

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

...cess.#times で計り、
Benchmark
::Tms オブジェクトを生成して返します。

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

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

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

#=>
#
# user system total real
# 1.166667 0.050000 1.216667 ( 0.571355)
//}...