Files
RubyMotion/test/Benchmark/app/benchmark.rb
2014-01-13 02:02:37 +09:00

35 lines
557 B
Ruby

sleep(1)
puts "# Benchmark Start"
begin
puts "RubyMotion #{RUBYMOTION_VERSION}"
rescue
# for CRuby
puts "Ruby #{RUBY_VERSION}"
require 'benchmark'
Dir.glob("app/benchmark/**/*.rb").each do |file|
load file
end
end
puts "*** Array ***"
autorelease_pool { bm_array }
puts "*** Hash ***"
autorelease_pool { bm_hash }
puts "*** Range ***"
autorelease_pool { bm_range }
puts "*** String ***"
autorelease_pool { bm_string }
puts "*** Time ***"
autorelease_pool { bm_time }
puts "*** Rational ***"
autorelease_pool { bm_rational }
exit(0)