Sha256: 59e030188ab97648f17e384373c5cc8fc609552688e1aafd2c8f07fc0f2749f2
Contents?: true
Size: 527 Bytes
Versions: 18
Compression:
Stored size: 527 Bytes
Contents
require 'benchmark/ips' puts "Ruby #{RUBY_VERSION} at #{Time.now}" puts firstname = 'soundarapandian' middlename = 'rathinasamy' lastname = 'arumugam' Benchmark.ips do |x| x.report("String\#<<") do |i| buffer = String.new while (i -= 1) > 0 buffer << 'Mr. ' << firstname << middlename << lastname << ' aka soundar' end end x.report("String interpolate") do |i| buffer = String.new while (i -= 1) > 0 buffer << "Mr. #{firstname} #{middlename} #{lastname} aka soundar" end end x.compare! end
Version data entries
18 entries across 18 versions & 1 rubygems