Marc Heiler wrote:
> (...)
> If you know a few more hints, please add!

Date and DateTime are time consuming. Time however, is not.

require 'benchmark'

N = 10000
Benchmark.bmbm do |bm|

   bm.report 'empty' do
     N.times do 1 end
   end

   bm.report 'DateTime' do
     N.times {DateTime.new}
   end

   bm.report 'Date' do
     N.times {Date.new}
   end

   bm.report 'Time' do
     N.times {Time.new}
   end

end

               user     system      total        real
empty      0.000000   0.000000   0.000000 (  0.000000)
DateTime   3.687000   0.063000   3.750000 (  3.813000)
Date       1.281000   0.000000   1.281000 (  1.313000)
Time       0.016000   0.000000   0.016000 (  0.015000)

Regards,

Siep

-- 
Posted via http://www.ruby-forum.com/.