るりまサーチ

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

別のキーワード

  1. etc sc_xopen_enh_i18n
  2. pop n_mails
  3. pop n_bytes
  4. openssl n
  5. openssl n=

種類

ライブラリ

モジュール

キーワード

検索結果

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

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

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

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

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

...
...えられます。Benchmark::Tms#total
: %r
実経過時間で置き換えられます。Benchmark::Tms#real
: %n
ラベルで置き換えられます(Mnemonic: n of "*n*ame")。Benchmark::Tms#label

//emlist[][ruby]{
require 'benchmark'

n =
50000

# これは
# Benchmark.bm(7, ">total:", ">...

Benchmark.#bm(label_width = 0, *labels) {|rep| ... } -> [Benchmark::Tms] (17217.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 (...
...83333 ( 0.694605)
# 1.516667 0.000000 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("up...

NEWS for Ruby 3.1.0 (12.0)

NEWS for Ruby 3.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

..., 13]]
//}

* ピン演算子がインスタンス変数、クラス変数、グローバル変数をサポートしました。 17724

//emlist{
@n = 5
Prime.each_cons(2).lazy.find{_1 in [n, ^@n]}
#=> [3, 5]
//}

* 1行パターンマッチが実験的な機能ではなくなりました。...
...更新(機能追加とバグ修正を除く)

* 以下のdefault gemsが更新されました。
* RubyGems 3.3.3
* base64 0.1.1
* benchmark 0.2.0
* bigdecimal 3.1.1
* bundler 2.3.3
* cgi 0.3.1
* csv 3.2.2
* date 3.2.2
* did_you_mean 1.6.1
* digest 3.1.0...

Ruby用語集 (12.0)

Ruby用語集 A B C D E F G I J M N O R S Y

...=[a:M] M

: Matz
Ruby の作者、まつもとゆきひろ(松本行弘)氏。

: Matz Ruby
=CRuby

: mix-in
ミックスイン

: MRI: Matz’ Ruby Implementation
CRuby

: mruby
組込み向けの Ruby 仕様および処理系。省メモリー性など、機器組み込みや...
...きる。
「x and y」「x || y」の and や || はメソッド呼び出しとは関係が
なく、再定義もできない。
代入式「n = 1」における「=」は代入演算子である。
「str.size」「user&.name」といったメソッド呼び出しにおける
「.」「&...
...ス変数、クラス変数がある。
変数とよく似たものとして、定数がある。

→代入

: ベンチマークテスト
: benchmark test
プログラムの速度性能を調べるソフトウェアテスト。
ベンチマークテストを行うため、各種の専用...