Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
22 lines (18 sloc) 914 Bytes
require 'benchmark'
amount = 100000
times = 100
Benchmark.bmbm do |bm|
bm.report("CONCAT") do
str = "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
j = 0
while (j < times)
i = 0
new_str = ""
while (i < amount)
new_str.concat(str)
i += 1
end
j += 1
end
end
end
Jump to Line
Something went wrong with that request. Please try again.