evanphx / benchmark-ips

Provides iteration per second benchmarking for Ruby
MIT License
1.72k stars 97 forks source link

Parameterize width? #131

Open zenspider opened 11 months ago

zenspider commented 11 months ago
8687 % g -w 20
lib/benchmark/ips/report.rb
95:              left.ljust(20) + (" - %s in %10.6fs" % [iters, runtime])
97:              left.ljust(20) + (" - %s" % iters)
103:              left.ljust(20) + (" - %10d in %10.6fs" % [@iterations, runtime])
105:              left.ljust(20) + (" - %10d" % @iterations)
110:        # Return header with padding if +@label+ is < length of 20.
113:          @label.to_s.rjust(20)

lib/benchmark/ips/job/stream_report.rb
51:        # Add padding to label's right if label's length < 20,
52:        # Otherwise add a new line and 20 whitespaces.
56:          if label.size > 20
57:            "#{label}\n#{' ' * 20}"
59:            label.rjust(20)

for the love of all that is holy... please pull this up to a config value