Skip to content

Instantly share code, notes, and snippets.

@francois
Created April 24, 2009 13:01
Show Gist options
  • Select an option

  • Save francois/101095 to your computer and use it in GitHub Desktop.

Select an option

Save francois/101095 to your computer and use it in GitHub Desktop.
$ ruby19 -v
ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-darwin9.6.0]
$ irb19
> puts Benchmark.realtime { 10000.times { Time.mktime(2008, 7, 15, 0, 0, 0) } }
0.101713895797729
> puts Benchmark.realtime { 10000.times { Date.civil(2008, 7, 15) } }
0.100281000137329
(posted here because http://blog.pluron.com/2009/04/ruby-date-class.html did not accept my comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment