Skip to content

Instantly share code, notes, and snippets.

Created February 4, 2013 02:02
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 anonymous/4704641 to your computer and use it in GitHub Desktop.
Save anonymous/4704641 to your computer and use it in GitHub Desktop.
Super simple benchmarker
run it as "ruby benchmark.rb [site] [iterations]"
require 'rest-client'
page, how_many = ARGV
total_elapsed = 0
how_many.to_i.times do
start = Time.now
RestClient.get page
total_elapsed = total_elapsed + (Time.now - start)
puts "#{Time.now - start} seconds to get #{page}"
end
puts "Average GET for #{page}: #{total_elapsed/how_many.to_i} seconds"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment