Sha256: 5bc37b393acebe962294dd47e853523588bd78e4b200cb187ce3e51bbfdafdd8
Contents?: true
Size: 580 Bytes
Versions: 10
Compression:
Stored size: 580 Bytes
Contents
lib = File.expand_path('../lib', __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'benchmark/ips' require 'character_set' def benchmark(caption: nil, cases: {}) puts caption report = Benchmark.ips do |x| cases.each do |label, callable| x.report(label, &callable) end x.compare! end return unless $store_comparison_results old_stdout = $stdout.clone captured_stdout = StringIO.new $stdout = captured_stdout report.run_comparison $store_comparison_results[caption] = captured_stdout.string $stdout = old_stdout end
Version data entries
10 entries across 10 versions & 1 rubygems