るりまサーチ

最速Rubyリファレンスマニュアル検索!
145件ヒット [1-100件を表示] (0.152秒)
トップページ > クエリ:-[x] > クエリ:h[x] > クエリ:a[x] > クエリ:report[x]

別のキーワード

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

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 > >>

Benchmark::Report#report(label = "", *fmt) { ... } -> Benchmark::Tms (24401.0)

ラベルと与えられたブロックの実行時間を標準出力に出力します。

...ラベルと与えられたブロックの実行時間を標準出力に出力します。

出力のフォーマットは Benchmark::Tms#format が行います。

@param label ラベル
@param fmt 結果に出力したいオブジェクト

@see Benchmark::Tms#format...

Benchmark::Job#report(label = "") { ... } -> self (21301.0)

与えられたラベルとブロックをジョブリストに登録します。

...与えられたラベルとブロックをジョブリストに登録します。

@param label ラベル...

Benchmark.#benchmark(caption = "", label_width = nil, fmtstr = nil, *labels) {|rep| ...} -> [Benchmark::Tms] (18552.0)

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

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

基本的には以下のように使います。
ブロックが Benchmark::Tms オブジェクトの配列を返した場合は、
それらの数値も追加の行に表示...
...す。

@param caption レポートの一行目に表示する文字列を指定します。
@param label_width ラベルの幅を指定します。
@param fmtstr フォーマット文字列を指定します。
この引数を省略すると Benchmark::FORMAT が使用...
...れます。
@param labels ブロックが Benchmark::Tms オブジェクトの配列を返す場合に指定します。

=== フォーマット文字列

フォーマット文字列として以下が使用できます。

: %u
user CPU time で置き換えられます。Benchmark::Tms#utime
: %...

Thread#report_on_exception -> bool (12262.0)

真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。

...時の Thread.report_on_exception です。

@param newstate スレッド実行中に例外発生した場合、その内容を報告するかどうかを true か false で指定します。

//emlist[例][ruby]{
a
= Thread.new{ Thread.stop; raise }
a
.report_on_exception = true
a
.report_on_exceptio...
...> true
a
.run
# => #<Thread:0x00007fc3f48c7908@(irb):1 run> terminated with exception (report_on_exception is true):
# Traceback (most recent call last):
# (irb):1:in `block in irb_binding': unhandled exception
# #<Thread:0x00007fc3f48c7908@(irb):1 dead>
b = Thread.new{ Thread.stop; raise }...
...b.report_on_exception = false
b.run # => #<Thread:0x00007fc3f48aefc0@(irb):4 dead>
//}

@see Thread.report_on_exception...

Thread.report_on_exception -> bool (12232.0)

真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。

...ルトは false です。

Thread.new { 1.times { raise } }

は $stderr に以下のように出力します:

#<Thread:...> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
2: from -e:1:in `block in <main>'
1: from -e:1:in `times...
...了しないようにするのがより良い方法です。
* Thread#join や Thread#value でそのスレッドの終了を待つことが保証できるなら、
スレッド開始時に Thread.current.report_on_exception = false でレポートを無効化しても
安全です。しか...
...なかったりするかもしれません。

スレッドごとに設定する方法は Thread#report_on_exception= を参照してください。

@param newstate スレッド実行中に例外発生した場合、その内容を報告するかどうかを true か false で指定します。...
...true です。

Thread.new { 1.times { raise } }

は $stderr に以下のように出力します:

#<Thread:...> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
2: from -e:1:in `block in <main>'
1: from -e:1:in `times'

これ...

絞り込み条件を変える

Thread.report_on_exception=(newstate) (12232.0)

真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。

...ルトは false です。

Thread.new { 1.times { raise } }

は $stderr に以下のように出力します:

#<Thread:...> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
2: from -e:1:in `block in <main>'
1: from -e:1:in `times...
...了しないようにするのがより良い方法です。
* Thread#join や Thread#value でそのスレッドの終了を待つことが保証できるなら、
スレッド開始時に Thread.current.report_on_exception = false でレポートを無効化しても
安全です。しか...
...なかったりするかもしれません。

スレッドごとに設定する方法は Thread#report_on_exception= を参照してください。

@param newstate スレッド実行中に例外発生した場合、その内容を報告するかどうかを true か false で指定します。...
...true です。

Thread.new { 1.times { raise } }

は $stderr に以下のように出力します:

#<Thread:...> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
2: from -e:1:in `block in <main>'
1: from -e:1:in `times'

これ...

Benchmark::Report.new(width = 0, fmtstr = nil) -> Benchmark::Report (9417.0)

Benchmark::Report のインスタンスを初期化して返します。

...Benchmark::Report のインスタンスを初期化して返します。

通常このメソッドがユーザーによって直接呼び出されることはありません。

@param width ラベルの幅
@param fmtstr フォーマット文字列...

Benchmark::Report#list -> [Benchmark::Tms] (9322.0)

Benchmark::Report#item 実行時に作成された Benchmark::Tms オ ブジェクトの一覧を返します。

...Benchmark::Report#item 実行時に作成された Benchmark::Tms オ
ブジェクトの一覧を返します。

@see Benchmark::Report#item...

Benchmark::Report#item(label = "", *fmt) { ... } -> Benchmark::Tms (9301.0)

ラベルと与えられたブロックの実行時間を標準出力に出力します。

...ラベルと与えられたブロックの実行時間を標準出力に出力します。

出力のフォーマットは Benchmark::Tms#format が行います。

@param label ラベル
@param fmt 結果に出力したいオブジェクト

@see Benchmark::Tms#format...

Benchmark.#bm(label_width = 0, *labels) {|rep| ... } -> [Benchmark::Tms] (6508.0)

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

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

Benchmark.#benchmark メソッドと同様に働きます。

@param label_width ラベルの幅を指定します。
@param labels ブロックが Benchmark::Tms オブジェクトの配列を返す場合に指定し...
...す。

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

n = 50000
Benchmark.bm do |x|
x.report { for i in 1..n; a = "1"; end }
x.report { n.times do ; a = "1"; end }
x.report { 1.upto(n) do ; a = "1"; end }
end

#=>
#
# user system total real
# 1.033333 0.016667 1.016667 ( 0....
...ruby]{
require 'benchmark'

n = 50000
Benchmark.bm(7) do |x|
x.report("for:") { for i in 1..n; a = "1"; end }
x.report("times:") { n.times do ; a = "1"; end }
x.report("upto:") { 1.upto(n) do ; a = "1"; end }
end

#=>
# user system total real
# for: 1.0500...

絞り込み条件を変える

<< 1 2 > >>