るりまサーチ

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

別のキーワード

  1. benchmark report
  2. thread report_on_exception
  3. thread report_on_exception=
  4. _builtin report_on_exception
  5. _builtin report_on_exception=

ライブラリ

モジュール

キーワード

検索結果

Benchmark.#bm(label_width = 0, *labels) {|rep| ... } -> [Benchmark::Tms] (55.0)

Benchmark.#benchmark メソッドの引数を簡略化したものです。

...場合に指定します。

//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.01...
...書けます。

//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 system total...
...uby]{
require 'benchmark'

n = 50000
Benchmark.bm(7, ">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:") { 1.upto(n) do ; a = "1"; end }
[tf + tt + tu, (tf + tt + tu) / 3]
end

#=>...

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

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

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

基本的には以下のように使います。
ブロックが Benchmark::Tms オブジェクトの配列を返した場合は、
それらの数値も追加の行に表示...
...rk::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:") { 1.upto(n) do ; a = "1"; end }

[tf+tt+tu, (tf+tt+tu)/3]
end

#=>
#
#...

Benchmark.#bmbm(width = 0) {|job| ... } -> [Benchmark::Tms] (13.0)

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

...幅を指定します。

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

array = (1..1000000).map { rand }

Benchmark.bmbm do |x|
x.report("sort!") { array.dup.sort! }
x.report("sort") { array.dup.sort }
end

#=>
#
# Rehearsal -----------------------------------------
# sort! 11.928000 0.010000 11...

FileUtils.#cd(dir, options = {}) -> 0 (7.0)

プロセスのカレントディレクトリを dir に変更します。

...ック終了後に
元のディレクトリに戻ります。

@param dir ディレクトリを指定します。

@param options :verbose が指定できます。
c:FileUtils#options

//emlist[][ruby]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}...

FileUtils.#cd(dir, options = {}) -> nil (7.0)

プロセスのカレントディレクトリを dir に変更します。

...ック終了後に
元のディレクトリに戻ります。

@param dir ディレクトリを指定します。

@param options :verbose が指定できます。
c:FileUtils#options

//emlist[][ruby]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}...

絞り込み条件を変える

FileUtils.#cd(dir, options = {}) {|dir| .... } -> nil (7.0)

プロセスのカレントディレクトリを dir に変更します。

...ック終了後に
元のディレクトリに戻ります。

@param dir ディレクトリを指定します。

@param options :verbose が指定できます。
c:FileUtils#options

//emlist[][ruby]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}...

FileUtils.#cd(dir, options = {}) {|dir| .... } -> object (7.0)

プロセスのカレントディレクトリを dir に変更します。

...ック終了後に
元のディレクトリに戻ります。

@param dir ディレクトリを指定します。

@param options :verbose が指定できます。
c:FileUtils#options

//emlist[][ruby]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}...

FileUtils.#chdir(dir, options = {}) -> 0 (7.0)

プロセスのカレントディレクトリを dir に変更します。

...ック終了後に
元のディレクトリに戻ります。

@param dir ディレクトリを指定します。

@param options :verbose が指定できます。
c:FileUtils#options

//emlist[][ruby]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}...

FileUtils.#chdir(dir, options = {}) -> nil (7.0)

プロセスのカレントディレクトリを dir に変更します。

...ック終了後に
元のディレクトリに戻ります。

@param dir ディレクトリを指定します。

@param options :verbose が指定できます。
c:FileUtils#options

//emlist[][ruby]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}...

FileUtils.#chdir(dir, options = {}) {|dir| .... } -> nil (7.0)

プロセスのカレントディレクトリを dir に変更します。

...ック終了後に
元のディレクトリに戻ります。

@param dir ディレクトリを指定します。

@param options :verbose が指定できます。
c:FileUtils#options

//emlist[][ruby]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}...

絞り込み条件を変える

FileUtils.#chdir(dir, options = {}) {|dir| .... } -> object (7.0)

プロセスのカレントディレクトリを dir に変更します。

...ック終了後に
元のディレクトリに戻ります。

@param dir ディレクトリを指定します。

@param options :verbose が指定できます。
c:FileUtils#options

//emlist[][ruby]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}...