Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get response time from curl request (via command-line)

How can I capture the response time from a CURL request?

curl https://www.google.com
like image 736
Andy Fleming Avatar asked May 20 '15 01:05

Andy Fleming


People also ask

Can you run curl from command line?

Invoke curl.exe from a command window (in Windows, click Start > Run and then enter "cmd" in the Run dialog box). You can enter curl --help to see a list of cURL commands.

How do I use the curl command to request?

To make a GET request using Curl, run the curl command followed by the target URL. Curl automatically selects the HTTP GET request method unless you use the -X, --request, or -d command-line option.


1 Answers

I found this approach in an article that returns a value in seconds

curl -o /dev/null -s -w %{time_total}\\n  https://www.google.com

It outputs something like:

0.059
like image 154
Andy Fleming Avatar answered Oct 27 '22 08:10

Andy Fleming