Skip to content

Instantly share code, notes, and snippets.

@mzemel
Created February 6, 2014 02:05
Show Gist options
  • Save mzemel/8837181 to your computer and use it in GitHub Desktop.
Save mzemel/8837181 to your computer and use it in GitHub Desktop.
10.times do
@rate ||= 0.0
start_time = Time.now.to_i
start_count = Property.external.count.to_f
sleep rand(30..60)
end_time = Time.now.to_i
end_count = Property.external.count.to_f
properties_per_second = ((end_count - start_count) / (end_time - start_time) )
@rate += properties_per_second
end
puts "Average: #{@rate / 10} properties per second"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment