Ruby 1.8.7 リファレンスマニュアル > ライブラリ一覧 > benchmarkライブラリ > Benchmarkモジュール

module Benchmark

クラスの継承リスト: Benchmark

要約

モジュール関数

定義 説明
benchmark(caption = "", label_width = nil, fmtstr = nil, *labels) {|rep| ...} -> bool

Benchmark::Report オブジェクトを生成し、それを引数として与えられたブロックを実行します。

bm(label_width = 0, *labels) {|rep| ... } -> bool

Benchmark.#benchmark メソッドの引数を簡略化したものです。

bmbm(width = 0) {|job| ... } -> [Benchmark::Tms]

Benchmark::Job オブジェクトを生成して、それを引数として与えられたブロックを 実行します。

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

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

realtime { ... } -> Float

与えられたブロックを評価して実行時間を計測して返します。

定数

定義 説明
BENCHMARK_VERSION

benchmark ライブラリのバージョンを表します。

CAPTION

Benchmark.#bm の内部などで使用されます。

FMTSTR

Benchmark.#benchmark の第三引数のデフォルト値。