るりまサーチ

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

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method gets
  4. irb/input-method new
  5. matrix -

ライブラリ

モジュール

検索結果

<< 1 2 3 ... > >>

Integer#times -> Enumerator (21326.0)

self 回だけ繰り返します。 self が正の整数でない場合は何もしません。

...self - 1 までの数値が渡されます。

//emlist[][ruby]{
3.times { puts "Hello, World!" } # Hello, World! と3行続いて表示される。
0.times { puts "Hello, World!" } # 何も表示されない。
5.times {|n| print n } # 01234 と表示される。
//}

@see Integer#upt...
...o, Integer#downto, Numeric#step...

Process.#times -> Process::Tms (21301.0)

自身のプロセスとその子プロセスが消費したユーザ/システム CPU 時間の積算を Process::Tms オブジェクトで返します。 時間の単位は秒で、浮動小数点数で与えられます。

...ム CPU 時間の積算を
Process::Tms オブジェクトで返します。
時間の単位は秒で、浮動小数点数で与えられます。

@raise NotImplementedError メソッドが現在のプラットフォームで実装されていない場合に発生します。

@see Process::Tms...

Integer#times {|n| ... } -> self (21226.0)

self 回だけ繰り返します。 self が正の整数でない場合は何もしません。

...self - 1 までの数値が渡されます。

//emlist[][ruby]{
3.times { puts "Hello, World!" } # Hello, World! と3行続いて表示される。
0.times { puts "Hello, World!" } # 何も表示されない。
5.times {|n| print n } # 01234 と表示される。
//}

@see Integer#upt...
...o, Integer#downto, Numeric#step...

VALUE rb_time_timespec_new(const struct timespec *ts, int offset) (12312.0)

引数 ts、offset を元に Time オブジェクトを作成して返します。

...ram ts timespec 構造体のポインタ

@param offset 協定世界時との時差(秒)。
-
86400 < offset < 86400 の場合は指定した時差に、INT_MAX
を指定した場合は地方時、INT_MAX-1 を指定した場合は UTC に
なります。

@r...
...aise ArgumentError offset に上述の範囲以外の値を指定した場合に発生し
ます。...

Benchmark.#benchmark(caption = "", label_width = nil, fmtstr = nil, *labels) {|rep| ...} -> [Benchmark::Tms] (9324.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
: %...

絞り込み条件を変える

Rake::FileCreationTask#timestamp -> Rake::EarlyTime (9300.0)

どんなタイムスタンプよりも前の時刻をあらわすタイムスタンプを返します。

...どんなタイムスタンプよりも前の時刻をあらわすタイムスタンプを返します。


@see [[FileTask#timestamp]]...

Rake::FileTask#timestamp -> Time | Rake::LateTime (9300.0)

ファイルタスクのタイムスタンプを返します。

...ファイルタスクのタイムスタンプを返します。

//emlist[][ruby]{
# Rakefile での記載例とする

task default: "test.txt"
file "test.txt" do |task|
R
ake.application.options.build_all = false
task.timestamp # => #<Rake::LateTime:0x2ba58f0>
end
//}...

Socket::AncillaryData#timestamp -> Time (9224.0)

タイムスタンプ制御メッセージに含まれる時刻を Time オブジェクト で返します。

...* SOL_SOCKET/SCM_TIMESTAMP (micro second) GNU/Linux, FreeBSD, NetBSD, OpenBSD, Solaris, MacOS X
* SOL_SOCKET/SCM_TIMESTAMPNS (nano second) GNU/Linux
* SOL_SOCKET/SCM_BINTIME (2**(-64) second) FreeBSD

r
equire 'socket'

Addrinfo.udp("127.0.0.1", 0).bind {|s1|
Addrinfo.udp("127.0.0.1"...
...|
s1.setsockopt(:SOCKET, :TIMESTAMP, true)
s2.send "a", 0, s1.local_address
ctl = s1.recvmsg.last
p ctl
#=> #<Socket::AncillaryData: INET SOCKET TIMESTAMP 2009-02-24 17:35:46.775581>
t = ctl.timestamp
p t #=> 2009-02-24 17:35:46 +0900
p t.usec...
...#=> 775581
p t.nsec #=> 775581000
}
}

@see Socket::Constants::SCM_TIMESTAMP,
Socket::Constants::SCM_TIMESTAMPNS,
Socket::Constants::SCM_BINTIME,
Socket::Constants::SO_TIMESTAMP,
Socket::Constants::SO_TIMESTAMPNS,
Socket::Constants::SO_BINTIME...

Thread.report_on_exception -> bool (9224.0)

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

...を $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'

これによってスレッドのエラーを早期に捕捉できるようになります。
いくつかのケースでは、この出力を望まないかもしれません。
出力を抑制するには複数の方法があります:

* 例外が...
...近い場所で rescue して、
その例外でスレッドが終了しないようにするのがより良い方法です。
* Thread#join や Thread#value でそのスレッドの終了を待つことが保証できるなら、
スレッド開始時に Thread.current.report_on_exception =...
...容を $stderr に報告します。

デフォルトは 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 `blo...
...ck in <main>'
1: from -e:1:in `times'

これによってスレッドのエラーを早期に捕捉できるようになります。
いくつかのケースでは、この出力を望まないかもしれません。
出力を抑制するには複数の方法があります:

* 例外が...

ThreadsWait#threads -> Array (9206.0)

同期されるスレッドの一覧を配列で返します。

...ドの一覧を配列で返します。

使用例
r
equire 'thwait'

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

thall = ThreadsWait.new(*threads)
p thall.threads
#=> [#<Thread:0x21750 sleep>, #<Thread:0x216c4 sleep>, #<Thread:0x21638 sleep>]...

絞り込み条件を変える

<< 1 2 3 ... > >>