lib/benchmark_driver/output/simple.rb in benchmark_driver-0.14.3 vs lib/benchmark_driver/output/simple.rb in benchmark_driver-0.14.4
- old
+ new
@@ -75,11 +75,13 @@
ensure
$stdout.sync = sync
end
def humanize(value)
- if value == BenchmarkDriver::Result::ERROR
- return 'ERROR'
+ if BenchmarkDriver::Result::ERROR.equal?(value)
+ return " %#{NAME_LENGTH}s" % 'ERROR'
+ elsif value == 0.0
+ return " %#{NAME_LENGTH}.3f" % 0.0
elsif value < 0
raise ArgumentError.new("Negative value: #{value.inspect}")
end
scale = (Math.log10(value) / 3).to_i