るりまサーチ

最速Rubyリファレンスマニュアル検索!
21件ヒット [1-21件を表示] (0.008秒)
トップページ > クエリ:then[x] > 種類:モジュール関数[x]

別のキーワード

  1. object then
  2. _builtin then
  3. then object
  4. then _builtin

ライブラリ

モジュール

検索結果

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

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

...m2=0

while true
do
x="($RANDOM/$M)"
y="($RANDOM/$M)"
c=$(echo "$S;$x^2+$y^2 < 1.0" | bc)
echo $x $y $c
if [ $c -eq 1 ]
then

let m1++
else
let m2++
fi
done
SHELL_EOT
}

File.chmod(0755, "loop.sh")
t = 10 # 10 秒でタイムアウト
beg...

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

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

...m2=0

while true
do
x="($RANDOM/$M)"
y="($RANDOM/$M)"
c=$(echo "$S;$x^2+$y^2 < 1.0" | bc)
echo $x $y $c
if [ $c -eq 1 ]
then

let m1++
else
let m2++
fi
done
SHELL_EOT
}

File.chmod(0755, "loop.sh")
t = 10 # 10 秒でタイムアウト
beg...