holidays/test/benchmark.rb

19 lines
340 B
Ruby
Raw Normal View History

2007-11-20 01:58:20 +01:00
require File.dirname(__FILE__) + '/test_helper'
require 'date'
require 'benchmark'
n = 10000
Benchmark.bm do |x|
x.report('calculate_mday') do
n.times do
Holidays.calculate_mday(2008, 1, 1, 3)
end
end
x.report('calculate_mdaya') do
n.times do
Holidays.calculate_mdaya(:third, 1, 1, 2008)
end
end
end