Sha256: 9de83697ef6db883cabe553ad6a5619dfb4a7480652cbc0dcd39a8f8b71e73d4

Contents?: true

Size: 314 Bytes

Versions: 17

Compression:

Stored size: 314 Bytes

Contents

require 'benchmark'

count = (ENV['COUNT'] || 5000).to_i

$benches = []
def bench(name, &block)
  $benches.push([name, block])
end

at_exit do
  Benchmark.bmbm do |x|
    $benches.each do |name, block|
      x.report name.to_s do
        count.times do
          block.call
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
angry_mob_common_targets-0.1.0 vendor/mustache/benchmarks/helper.rb
mustache-0.5.1 benchmarks/helper.rb
mustache-0.5.0 benchmarks/helper.rb
mustache-0.4.2 benchmarks/helper.rb
mustache-0.4.1 benchmarks/helper.rb
mustache-0.4.0 benchmarks/helper.rb
mustache-0.3.2 benchmarks/helper.rb
mustache-0.3.1 benchmarks/helper.rb
mustache-0.3.0 benchmarks/helper.rb
mustache-0.2.2 benchmarks/helper.rb
mustache-0.2.1 benchmarks/helper.rb
mustache-0.2.0 benchmarks/helper.rb
mustache-0.1.4 benchmarks/helper.rb
mustache-0.1.3 benchmarks/helper.rb
mustache-0.1.2 benchmarks/helper.rb
mustache-0.1.1 benchmarks/helper.rb
mustache-0.1.0 benchmarks/helper.rb