It’s easy to time curl requests (or any program) with the time command:

$ time curl -I

But it’s also possible to profile curl requests in greater detail using the --write-out option (-w for short), including timing, download speed and size, and other variables.

For example:

$ curl -I -w "\ntime_total: %{time_total} sec\nsize_download: %{size_download} bytes\nspeed_download: %{speed_download}\nsize_request: %{size_request}\ntime_namelookup: %{time_namelookup}"

This request measured:

  1. time_total: The total time of the operation
  2. size_download: The total amount of downloaded bytes
  3. speed_download: The average download speed in bytes per second
  4. size_request: The total amount of bytes sent in the request
  5. time_name_lookup: The time in seconds until name resolution completed

There are more variables available. Run man curl or see the man page for full details on the -w option.