Method: Quicky::Timer#loop

Defined in:
lib/quicky/timer.rb

#loop(name, x, options = {}, &blk) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/quicky/timer.rb', line 11

def loop(name, x, options={}, &blk)
  if options[:warmup]
    options[:warmup].times do |i|
      #puts "Warming up... #{i}"
      yield
    end
  end
  x.times do |i|
    time(name, options, &blk)
  end
end