Sha256: 782d6e387a04d70548fe5d1f53451b41de8b91ad8c3de68e22f2e471093efacb

Contents?: true

Size: 415 Bytes

Versions: 6

Compression:

Stored size: 415 Bytes

Contents

require 'benchmark'
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'lib'))
require 'holiday_jp'

def bench_holiday
Benchmark.measure {
  d = Date.new(2011, 9, 19)
  10000.times do
    HolidayJp.holiday?(d)
  end
}
end
def bench_between
Benchmark.measure {
  d = Date.new(2009, 1, 1)
  d2 = Date.new(2009, 12, 31)
  10000.times do
    HolidayJp.between(d,d2)
  end
}
end

puts bench_holiday
puts bench_between

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
holiday_jp-0.4.3 benchmark.rb
holiday_jp-0.4.2 benchmark.rb
holiday_jp-0.4.1 benchmark.rb
holiday_jp-0.4.0 benchmark.rb
holiday_jp-0.3.1 benchmark.rb
holiday_jp-0.3.0 benchmark.rb