I am trying to perform some benchmarking and having some issues with Request. The problem is that if the response time is high it throws some errors. How can I make it return the else
if the request.get
waits more than for instance 2 seconds.
time = requests.get('http://www.google.com').elapsed.total_seconds()
if time < 1:
print "Low response time"
else:
print "High reponse time"