benchmarks/strcat.rb
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 11 Sep 2013 11:36:27 +0100
branchdevelopment
changeset 2727 0d4d725cc712
parent 2598 94ae3f5f4df1
permissions -rwxr-xr-x
Initial support for selector highlighting.

#!/usr/bin/env ruby
require 'benchmark'

results = Benchmark.bmbm do |bm|
  raise "Expecting one arg - num of iterations" if ARGV.size == 0
  n = ARGV[0].to_i
  hello = "hello\n"
  result = ""
  10.times { result << hello }
  bm.report { n.times { result << hello } }
end
puts "EXECUTION TIME: #{results[0].real * 1000.0}"