title: Iterating over Hours for 1 month in Ruby takes 15 seconds - What's the best way to iterate over intervals of time in Ruby?
body: <p>If I iterate over 1 month of time to do something for each hour, it takes about 14 seconds using <code>Range#step</code>:</p>
  
  <pre><code>bm = Benchmark.measure do
    (Time.now..(Time.now + 1.month)).step(1.hour) { |hour| puts hour.inspect }
  end
  puts bm
  =&gt; 14.750000   0.060000  14.810000 ( 14.907838)
  </code></pre>
  
  <p>That's because it's iterating over every [second]?  What is the best way to create and iterate over a range of times for each hour, from the beginning of the hour?</p>
  
  <pre><code>range == [...Wed Feb 09 11:00:00 -0600 2011, Wed Feb 09 12:00:00 -0600 2011, ...]
  </code></pre>