Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for a simple tool or built-in command that will allow me to measure with millisecond accuracy the time it takes to fetch a remote web page from a given URL.

share|improve this question
up vote 10 down vote accepted

Does this do what you're looking for?

time wget http://example.com
share|improve this answer
    
This will include the time it takes to start and run wget, which can be significantly longer than the server's response time. – Paul Lynch May 27 at 15:10
    
@PaulLynch: I did a simple test. I ran this in one terminal: rm foo; touch foo; python -m SimpleHTTPServer and in another: time wget --quiet --output-document=/dev/null localhost:8000/foo and the result was 2 milliseconds. I ran the same wget against google.com (which retrieves about 10K characters) and got about a quarter of a second. So let's call the start/run time about 1% in that case. Then, for comparison, I did time curl file://foo and got about 4 milliseconds. – Dennis Williamson May 27 at 16:26
    
It seems you are right, for http requests-- for which I get only about 2ms of slowdown. I was trying to get an https URL. For that, wget is about 25ms slower for a request Chrome returns in about 10ms (and not "from cache"). Both wget and Chrome are running on the same machine as the webserver, and are addressing it as "localhost", so I blame wget for the time difference. – Paul Lynch May 31 at 15:33

Httping will do that.

Httping is like 'ping' but for http-requests. Give it an url, and it'll show you how long it takes to connect, send a request and retrieve the reply (only the headers). Be aware that the transmission across the network also takes time! So it measures the latency of the webserver + network.

share|improve this answer

Wireshark will let you examine a transfer in a lot of detail. You can see how long it takes to download a single file, as Dennis suggested, or if you open the URL in a web browser, you can see how long it takes to load all of the related files (images, scripts, etc).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.