summaryrefslogtreecommitdiff
path: root/lib/benchmark.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/benchmark.rb')
-rw-r--r--lib/benchmark.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/benchmark.rb b/lib/benchmark.rb
index 4cfc0d8a5b..361bca3cad 100644
--- a/lib/benchmark.rb
+++ b/lib/benchmark.rb
@@ -163,8 +163,8 @@ module Benchmark
#
def benchmark(caption = "", label_width = nil, format = nil, *labels) # :yield: report
- sync = STDOUT.sync
- STDOUT.sync = true
+ sync = $stdout.sync
+ $stdout.sync = true
label_width ||= 0
label_width += 1
format ||= FORMAT
@@ -176,7 +176,7 @@ module Benchmark
}
report.list
ensure
- STDOUT.sync = sync unless sync.nil?
+ $stdout.sync = sync unless sync.nil?
end
@@ -247,8 +247,8 @@ module Benchmark
job = Job.new(width)
yield(job)
width = job.width + 1
- sync = STDOUT.sync
- STDOUT.sync = true
+ sync = $stdout.sync
+ $stdout.sync = true
# rehearsal
puts 'Rehearsal '.ljust(width+CAPTION.length,'-')
@@ -268,7 +268,7 @@ module Benchmark
Benchmark.measure(label, &item).tap { |res| print res }
}
ensure
- STDOUT.sync = sync unless sync.nil?
+ $stdout.sync = sync unless sync.nil?
end
#