# File lib/railsbench/benchmark.rb, line 173 def benchmark(caption = "", label_width = nil, fmtstr = nil, *labels) # :yield: report if SYNC sync = OUTPUT.sync OUTPUT.sync = true end label_width ||= 0 fmtstr ||= FMTSTR raise ArgumentError, "no block" unless iterator? OUTPUT.print caption results = yield(Report.new(label_width, fmtstr)) Array === results and results.grep(Tms).each {|t| OUTPUT.print((labels.shift || t.label || "").ljust(label_width), t.format(fmtstr)) } OUTPUT.sync = sync if SYNC end