Skip to content

Instantly share code, notes, and snippets.

@danahern
Created March 2, 2009 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danahern/72982 to your computer and use it in GitHub Desktop.
Save danahern/72982 to your computer and use it in GitHub Desktop.
offset = 0
time_started = Time.now
while !(listings = Listing.find(:all, :conditions => ["dealership_reference_number is not null and dealership_id is not null and created_on < ?", '2009-02-01'], :limit => 1000, :offset => offset*1000)).blank? do
time_elapsed = Time.now-time_started
puts offset.to_s+": "+time_elapsed.to_s
offset += 1
time_started = Time.now
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment