To measure the response time of a URL using curl, you can use the -w option to format the output and display the time details. Here's a command to measure and display the response time of a URL:
curl -o /dev/null -s -w "Time to connect: %{time_connect}\nTime to start transfer: %{time_starttransfer}\nTotal time: %{time_total}\n" https://example.comHere's a breakdown of what each option does:
-o /dev/null: Discards the body of the response.-s: Makescurlsilent, i.e., it doesn't show progress or error messages.-w "Time to connect: %{time_connect}\nTime to start transfer: %{time_starttransfer}\nTotal time: %{time_total}\n": Prints the specified time metrics.
You can replace https://example.com with the URL you want to test. When you run this command, you will get the connection time, the time to start transferring data, and the total time taken for the request.