# File lib/benchmark/ips/job/stdout_report.rb, line 28 def add_report(item, caller) $stdout.puts " #{item.body}" end
# File lib/benchmark/ips/job/stdout_report.rb, line 9 def start_running $stdout.puts "Calculating -------------------------------------" end
# File lib/benchmark/ips/job/stdout_report.rb, line 5 def start_warming $stdout.puts "Warming up --------------------------------------" end
# File lib/benchmark/ips/job/stdout_report.rb, line 13 def warming(label, _warmup) $stdout.print rjust(label) end
# File lib/benchmark/ips/job/stdout_report.rb, line 17 def warmup_stats(_warmup_time_us, timing) case format when :human $stdout.printf "%s i/100ms\n", Helpers.scale(timing) else $stdout.printf "%10d i/100ms\n", timing end end
@return [Symbol] format used for benchmarking
# File lib/benchmark/ips/job/stdout_report.rb, line 35 def format Benchmark::IPS.options[:format] end
Add padding to label's right if label's length < 20, Otherwise add a new line and 20 whitespaces. @return [String] Right justified label.
# File lib/benchmark/ips/job/stdout_report.rb, line 42 def rjust(label) label = label.to_s if label.size > 20 "#{label}\n#{' ' * 20}" else label.rjust(20) end end