Files
RubyMotion/test/Benchmark/app/benchmark/string/dup.rb
2014-02-13 00:15:10 +09:00

18 lines
331 B
Ruby

# -*- coding: utf-8 -*-
def string_dup(x)
ascii = "The quick brown fox jumps over the lazy dog."
utf8 = "飛べねぇ豚はタダの豚だ...................."
x.report "dup with ASCII" do
100000.times do
ascii.dup
end
end
x.report "dup with UTF8" do
100000.times do
utf8.dup
end
end
end