るりまサーチ

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

別のキーワード

  1. _builtin to_h
  2. hash to_h
  3. env to_h
  4. array to_h
  5. struct to_h

ライブラリ

モジュール

検索結果

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

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

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

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

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

puts Benchmark::CAPTION
puts Benchmark.measure { "a"*1_000_0...