Skip to content

Commit

Permalink
add two more somewhat common time formats to parse benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuck Remes committed Mar 18, 2011
1 parent c94b07f commit 8045146
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions benchmark/core/time/bench_parse.rb
Expand Up @@ -18,6 +18,8 @@
rfc2822_date_time_cst = "08 Mar 11 10:09:08 CST" rfc2822_date_time_cst = "08 Mar 11 10:09:08 CST"


format_c = "Fri Jan 02 08:10:00 -0600 2004" format_c = "Fri Jan 02 08:10:00 -0600 2004"
format_d = "Fri, 02 Jan 2004 08:10:00 -0600"
format_e = "2011/03/08 10:09:08 -0600"




x.report "parse '#{iso_8601_date_only_locale_neutral}'" do |times| x.report "parse '#{iso_8601_date_only_locale_neutral}'" do |times|
Expand Down Expand Up @@ -108,4 +110,20 @@
end end
end end


x.report "parse '#{format_d}'" do |times|
i = 0
while i < times
Time.parse(format_d)
i += 1
end
end

x.report "parse '#{format_e}'" do |times|
i = 0
while i < times
Time.parse(format_e)
i += 1
end
end

end end

0 comments on commit 8045146

Please sign in to comment.