1件ヒット
[1-1件を表示]
(0.077秒)
検索結果
-
Benchmark
. # measure(label = "") { . . . } -> Benchmark :: Tms (105748.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...