るりまサーチ

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

別のキーワード

  1. timeout timeout
  2. kernel timeout
  3. openssl timeout
  4. openssl timeout=
  5. timeout timeouterror

ライブラリ

モジュール

検索結果

Timeout.#timeout(sec, exception_class = nil) {|i| ... } -> object (35257.0)

ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。

...c 秒の期限付きで実行します。
ブロックの実行時間が制限を過ぎたときは例外
Timeout
::Error が発生します。

exception_class を指定した場合には Timeout::Error の代わりに
その例外が発生します。
ブロックパラメータ i は sec がはい...
...ウト
require 'timeout'

def calc_pi(min)
loop do
x = rand
y = rand
x**2 + y**2 < 1.0 ? min[0] += 1 : min[1] += 1
end
end

t = 5
min = [ 0, 0]
begin
Timeout
.timeout(t){
calc_pi(min)
}
rescue Timeout::Error
puts "timeout"
end

printf "%...
...るタイムアウト
#!/usr/bin/env ruby

require 'timeout'

class MYError < Exception;end
begin
Timeout
.timeout(5, MYError) {
sleep(30)
}
rescue MYError => err
puts "MYError"
puts err
end

=== 注意

timeout
による割り込みは Thread によって実現さ...

Timeout.#timeout(sec, exception_class, message) {|i| ... } -> object (35257.0)

ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。

...c 秒の期限付きで実行します。
ブロックの実行時間が制限を過ぎたときは例外
Timeout
::Error が発生します。

exception_class を指定した場合には Timeout::Error の代わりに
その例外が発生します。
ブロックパラメータ i は sec がはい...
...ウト
require 'timeout'

def calc_pi(min)
loop do
x = rand
y = rand
x**2 + y**2 < 1.0 ? min[0] += 1 : min[1] += 1
end
end

t = 5
min = [ 0, 0]
begin
Timeout
.timeout(t){
calc_pi(min)
}
rescue Timeout::Error
puts "timeout"
end

printf "%...
...るタイムアウト
#!/usr/bin/env ruby

require 'timeout'

class MYError < Exception;end
begin
Timeout
.timeout(5, MYError) {
sleep(30)
}
rescue MYError => err
puts "MYError"
puts err
end

=== 注意

timeout
による割り込みは Thread によって実現さ...

Timeout.#timeout(sec, exception_class = nil) {|i| ... } -> object (35256.0)

ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。

...c 秒の期限付きで実行します。
ブロックの実行時間が制限を過ぎたときは例外
Timeout
::Error が発生します。

exception_class を指定した場合には Timeout::Error の代わりに
その例外が発生します。
ブロックパラメータ i は sec がはい...
...ウト
require 'timeout'

def calc_pi(min)
loop do
x = rand
y = rand
x**2 + y**2 < 1.0 ? min[0] += 1 : min[1] += 1
end
end

t = 5
min = [ 0, 0]
begin
Timeout
.timeout(t){
calc_pi(min)
}
rescue Timeout::Error
puts "timeout"
end

printf "%...
...るタイムアウト
#!/usr/bin/env ruby

require 'timeout'

class MYError < Exception;end
begin
Timeout
.timeout(5, MYError) {
sleep(30)
}
rescue MYError => err
puts "MYError"
puts err
end

=== 注意

timeout
による割り込みは Thread によって実現さ...

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

IO.select と同じです。

...IO.select と同じです。

@param reads IO.select 参照
@param writes IO.select 参照
@param excepts IO.select 参照
@param timeout IO.select 参照


@see IO.select...