12

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.

GJ.
  • 10,151

4 Answers4

12

Does this do what you're looking for?

time wget http://example.com
7

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.

garyjohn
  • 36,494
5

You can do it with curl as per this answer

Create a new file, curl-format.txt, and paste in:

    time_namelookup:  %{time_namelookup}\n
       time_connect:  %{time_connect}\n
    time_appconnect:  %{time_appconnect}\n
   time_pretransfer:  %{time_pretransfer}\n
      time_redirect:  %{time_redirect}\n
 time_starttransfer:  %{time_starttransfer}\n
                    ----------\n
         time_total:  %{time_total}\n

Then run curl like this:

curl -w "@curl-format.txt" -o /dev/null -s "http://wordpress.com/"

3

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).

Neil
  • 472
  • 3
  • 9