I'm trying to build a tool for testing the delay of my internet connection, more specifically web site load times. I thought of using the python requests module for the loading part.
Problem is, it's got no built-in functionality to measure the time it took to get the full response. For this I thought I would use the
t = timeit.Timer("requests.get('http://www.google.com')", "import requests")
If you are not performing a single load time test for the Web, you can use
This is a very good way to perform web application load / stress test and get a picture of load / response times.
As for your question, it should be the total time for
Other ways to measure a single request load time is to use urllib:
nf = urllib.urlopen(url) start = time.time() page = nf.read() end = time.time() nf.close() # end - start gives you the page load time