class Benchmark::BigO::Job::Entry

Public Class Methods

new(label, action, generated, size) click to toggle source
Calls superclass method
# File lib/benchmark/bigo/job.rb, line 8
def initialize label, action, generated, size
  super label, action

  if @as_action
    raise "as_action not supported yet"
  else
    raise ArgumentError if action.arity != 2
    @call_loop = false
  end

  # these objects can be very large, do not want
  # them to be displayed as part of inspect
  define_singleton_method(:generated) { generated }
  define_singleton_method(:size) { size }
end

Public Instance Methods

call_times(times) click to toggle source
# File lib/benchmark/bigo/job.rb, line 24
def call_times(times)
  act = @action

  i = 0
  while i < times
    act.call generated, size
    i += 1
  end
end