mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-23 20:31:17 +08:00
add benchmark for Module
This commit is contained in:
14
test/Benchmark/app/benchmark/module/class_variable_set.rb
Normal file
14
test/Benchmark/app/benchmark/module/class_variable_set.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
def module_class_variable_set(x)
|
||||
x.report "class_variable_set" do
|
||||
100000.times do |i|
|
||||
Foo.class_variable_set(:"@@foo#{i}", 42)
|
||||
end
|
||||
end
|
||||
|
||||
x.report "class_variable_set (included)" do
|
||||
100000.times do |i|
|
||||
Bar.class_variable_set(:"@@baz#{i}", 42)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user