るりまサーチ

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

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. csv to_i
  5. _builtin i

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 > >>

Thread::Backtrace::Location#label -> String (24213.0)

self が表すフレームのラベルを返します。通常、メソッド名、クラス名、モ ジュール名などで構成されます。

...フレームのラベルを返します。通常、メソッド名、クラス名、モ
ジュール名などで構成されます。

例: Thread::Backtrace::Location の例1を用いた例

//emlist[][ruby]{
loc = c(0..1).first
loc.label # => "a"
//}

@see Thread::Backtrace::Location#base_label...

Benchmark::Tms#label -> String (21201.0)

ラベル。

ラベル。

Thread::Backtrace::Location#base_label -> String (12229.0)

self が表すフレームの基本ラベルを返します。通常、 Thread::Backtrace::Location#label から修飾を取り除いたもので構成 されます。

...Thread::Backtrace::Location#label から修飾を取り除いたもので構成
されます。

//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end

Foo.new(0..2).locations.map do |call|
puts call.base_label...
...end

# => initialize
# new
# <main>
//}

@see Thread::Backtrace::Location#label...

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

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

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

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

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

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

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

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

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

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

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

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

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

@see Benchmark::Tms#format...

絞り込み条件を変える

Benchmark::Job#item(label = "") { ... } -> self (9208.0)

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

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

@param label ラベル...

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

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

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

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

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

@see Benchmark::Tms#format...

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

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

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

@param label ラベル...

Benchmark::Tms.new(utime = 0.0, stime = 0.0, cutime = 0.0, cstime = 0.0, real = 0.0, label = nil) -> Benchmark::Tms (3607.0)

新しい Benchmark::Tms オブジェクトを生成して返します。

...新しい Benchmark::Tms オブジェクトを生成して返します。

@param utime User CPU time
@param stime System CPU time
@param cutime 子プロセスの User CPU time
@param cstime 子プロセスの System CPU time
@param real 実経過時間
@param label ラベル...

Benchmark.#bm(label_width = 0, *labels) {|rep| ... } -> [Benchmark::Tms] (3425.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 (...
...0000 1.516667 ( 0.711077)
//}

以下のようにも書けます。

//emlist[][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...

絞り込み条件を変える

<< 1 2 > >>