Skip to content

Instantly share code, notes, and snippets.

@benr75
Last active November 22, 2016 19:15
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 benr75/3a18542b2f12a0074ed8bbafa30de119 to your computer and use it in GitHub Desktop.
Save benr75/3a18542b2f12a0074ed8bbafa30de119 to your computer and use it in GitHub Desktop.
Quick script to check how long it takes to get an http resource
require 'curb'
if ARGV[0].nil? || ARGV[1].nil?
puts "usage 'ruby checkfeed.rb FEEDURL TIMESTORUN'"
else
ttr = ARGV[1].to_i
x = 0
while x < ttr
http = Curl.get(ARGV[0])
puts http.total_time
x = x + 1
sleep(5)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment