gautam
gautam

Reputation: 197

Curl command to get time taken

I'm running a curl command:

curl -s -w "\n\n%{time_connect} + %{time_starttransfer} = %{time_total}\n\n" GET http://www.google.com

and the response that I'm getting is:

0.000 + 0.000 = 0.000

<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.google.co.in/?gfe_rd=cr&amp;dcr=0&amp;ei=zWUAWsbbDabU-APf85KoBQ">here</A>.
</BODY></HTML>


0.217 + 0.416 = 0.417

So one thing that I'm not understanding is that why two instances of the time taken and what are they representing ??

0.000 + 0.000 = 0.000

0.217 + 0.416 = 0.417

Upvotes: 5

Views: 17643

Answers (1)

skr
skr

Reputation: 2286

You don't need GET in curl command and it try GET and fails and that result is given in with first output with zeros.

Remove the GET from the curl command and try.

curl -w "\n\n%{time_connect} + %{time_starttransfer} = %{time_total}\n" www.google.com 

Upvotes: 15

Related Questions