benchmarks/ruby/strcat.rb
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 04 Feb 2019 00:24:10 +0000
changeset 3886 292b73957757
parent 3499 baa25013b3ec
permissions -rwxr-xr-x
Fix initialization of system propertirs ...and use `amd64` consistenly instead of `x86_64`.

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