るりまサーチ

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

別のキーワード

  1. date upto
  2. _builtin upto
  3. integer upto
  4. string upto
  5. macros log_upto

種類

ライブラリ

モジュール

検索結果

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

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

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

基本的には以下のように使います。
ブロックが Benchmark::Tms オブジェクトの配列を返した場合は、
それらの数値も追加の行に表示...
...tstr フォーマット文字列を指定します。
この引数を省略すると Benchmark::FORMAT が使用されます。
@param labels ブロックが Benchmark::Tms オブジェクトの配列を返す場合に指定します。

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

...
..."*7 + Benchmark::CAPTION,
7,
Benchmark
::FORMAT,
">total:",
">avg:") do |x|

tf = x.report("for:") { for i in 1..n; a = "1"; end }
tt = x.report("times:") { n.times do ; a = "1"; end }
tu = x.report("upto:") {...

Benchmark.#bm(label_width = 0, *labels) {|rep| ... } -> [Benchmark::Tms] (17241.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 (...
...のようにも書けます。

//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 }
end

#=>
# user syst...

1.6.8から1.8.0への変更点(まとめ) (36.0)

1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))

...のライブラリが新たに追加されました。
((<iconv>)), ((<tsort>)), ((<StringIO>)), ((<strscan>)),
((<fileutils>)), racc/*

: ((<benchmark>)) [new]
added

: Curses [lib] [compat]

Updated. New methods and constants for using the mouse, character
attributes, colors and...
...586-linux]
3
nil
=> ruby 1.8.0 (2003-07-03) [i586-linux]
nil
nil

: ((<String#upto|String/upto>)) [bug]

String#upto の範囲チェックが辞書順だったバグが修正されました。
現在は、((<String/succ>)) の動作と一致し...
...2-12-24) [i586-linux]
["a"]
=> ruby 1.8.0 (2003-07-03) [i586-linux]
["a", "b", "c", ..., "y", "z", "aa"]

'a'.upto('aa') {|c| p c}
=> ruby 1.6.8 (2002-12-24) [i586-linux]
"a"
=> ruby 1.8.0 (2003-07-03) [i586-linux]
"a"...