Project

General

Profile

Bug #9221 ยป time_parse.rb

script to demonstrate Time.parse performance degredation - mpelzsherman (Michael Pelz-Sherman), 12/05/2013 10:53 PM

 
require 'time'

def time_parse(s)
puts "parsing #{s}"
start = Time.now
puts Time.parse(s)
finish = Time.now
puts "elapsed: #{finish - start}"
end

time_str = "12:00 PM "
40.times do
time_parse(time_str)
time_str << "f"
end
    (1-1/1)