Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
6
Task/Time-a-function/Ruby/time-a-function-1.rb
Normal file
6
Task/Time-a-function/Ruby/time-a-function-1.rb
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
require 'benchmark'
|
||||
|
||||
Benchmark.bm(8) do |x|
|
||||
x.report("nothing:") { }
|
||||
x.report("sum:") { (1..1_000_000).inject(4) {|sum, x| sum + x} }
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue