method

assert_performance

Importance_1
v1_9_3_125 - Show latest stable - 0 notes - Class: TestCase
assert_performance(validation, &work) public

Runs the given work, gathering the times of each run. Range and times are then passed to a given validation proc. Outputs the benchmark name and times in tab-separated format, making it easy to paste into a spreadsheet for graphing or further analysis.

Ranges are specified by ::bench_range.

Eg:

def bench_algorithm
  validation = proc { |x, y| ... }
  assert_performance validation do |x|
    @obj.algorithm
  end
end
Show source
Register or log in to add new notes.