benchmarks/strcat.rb
author Jan Vrany <jan.vrany@fit.cvut.cz>
Tue, 10 Sep 2013 10:25:34 +0100
branchdevelopment
changeset 2723 02802ba0024f
parent 2598 94ae3f5f4df1
permissions -rwxr-xr-x
Added JavaSourceParser - a base class for JavaSyntaxHighlighter.

#!/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}"