module DateByExample

Constants

VERSION

Public Class Methods

benchmark() click to toggle source
# File lib/date_by_example.rb, line 10
def self.benchmark
  dt = DateTime.new(2018, 6, 9, 13, 15)
  Benchmark.bm do |x|
    x.report do
      1_000_000.times do
        ExampleFormatter.new("2 Jan 06 15:04").format(dt)
      end
    end
  end

  # GSUB version is 16.15 seconds
end