Sha256: 7fdd76af73ef9a1849e04157abab6e7ad7364aee7f241e38a285c9573fadece9

Contents?: true

Size: 449 Bytes

Versions: 7

Compression:

Stored size: 449 Bytes

Contents

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

def bench_holiday
  Benchmark.measure do
    d = Date.new(2011, 9, 19)
    10000.times do
      HolidayJp.holiday?(d)
    end
  end
end

def bench_between
  Benchmark.measure do
    d = Date.new(2009, 1, 1)
    d2 = Date.new(2009, 12, 31)
    10000.times do
      HolidayJp.between(d, d2)
    end
  end
end

puts bench_holiday
puts bench_between

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
holiday_jp-0.8.1 benchmark.rb
holiday_jp-0.8.0 benchmark.rb
holiday_jp-0.7.1 benchmark.rb
holiday_jp-0.7.0 benchmark.rb
holiday_jp-0.6.1 benchmark.rb
holiday_jp-0.5.1 benchmark.rb
holiday_jp-0.5.0 benchmark.rb