るりまサーチ

最速Rubyリファレンスマニュアル検索!
55件ヒット [1-55件を表示] (0.015秒)
トップページ > クエリ:times[x] > 種類:特異メソッド[x]

別のキーワード

  1. _builtin times
  2. integer times
  3. process times
  4. times _builtin

ライブラリ

クラス

キーワード

検索結果

Thread.report_on_exception -> bool (13.0)

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

...

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) (13.0)

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

...

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'

これによって...

Coverage.line_stub(file) -> Array (7.0)

行カバレッジの配列のスタブを返します。

...要素は 0, 空行やコメントなどにより測定対象外となる行の要素は nil となります。

//emlist[foo.rb][ruby]{
s = 0
10.times do |x|
s += x
end

if s == 45
p :ok
else
p :ng
end
//}

このファイルに対して line_stub を実行すると、次のようになりま...

IO.select(reads, writes = [], excepts = [], timeout = nil) -> [[IO]] | nil (7.0)

select(2) を実行します。

...ていた時に発生します。

@raise Errno::EXXX select(2) に失敗した場合に発生します。

rp, wp = IO.pipe
mesg = "ping "
100.times{
rs, ws, = IO.select([rp], [wp])
if r = rs[0]
ret = r.read(5)
print ret
case ret
when /ping/
mesg = "pong\n"...

ThreadsWait.all_waits(*threads) -> () (7.0)

指定されたスレッドすべてが終了するまで待ちます。 ブロックが与えられた場合、スレッド終了時にブロックを評価します。

...ます。

@param threads 終了するまでまつスレッドを一つもしくは複数指定します。

require 'thwait'

threads = []
5.times {|i|
threads << Thread.new { sleep 1; p Thread.current }
}
ThreadsWait.all_waits(*threads) {|th| printf("end %s\n", th.inspect) }

# 出...

絞り込み条件を変える

ThreadsWait.all_waits(*threads) {|thread| ...} -> () (7.0)

指定されたスレッドすべてが終了するまで待ちます。 ブロックが与えられた場合、スレッド終了時にブロックを評価します。

...ます。

@param threads 終了するまでまつスレッドを一つもしくは複数指定します。

require 'thwait'

threads = []
5.times {|i|
threads << Thread.new { sleep 1; p Thread.current }
}
ThreadsWait.all_waits(*threads) {|th| printf("end %s\n", th.inspect) }

# 出...

ThreadsWait.new(*threads) -> ThreadsWait (7.0)

指定されたスレッドの終了をまつための、スレッド同期オブジェクトをつくります。

...す。

@param threads 終了を待つスレッドを一つもしくは複数指定します。

使用例
require 'thwait'

threads = []
5.times {|i|
threads << Thread.new { sleep 1; p Thread.current }
}

thall = ThreadsWait.new(*threads)
thall.all_waits{|th|
printf("end %s\n"...