我正在运行 curl 命令:
curl -s -w "\n\n%{time_connect} + %{time_starttransfer} = %{time_total}\n\n" GET http://www.google.com
Run Code Online (Sandbox Code Playgroud)
我得到的回应是:
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&dcr=0&ei=zWUAWsbbDabU-APf85KoBQ">here</A>.
</BODY></HTML>
0.217 + 0.416 = 0.417
Run Code Online (Sandbox Code Playgroud)
所以我不明白的一件事是为什么需要两个时间实例以及它们代表什么?
0.000 + 0.000 = 0.000
0.217 + 0.416 = 0.417
Run Code Online (Sandbox Code Playgroud)
您不需要GETincurl命令,它尝试GET并失败,并且该结果在第一个输出为零时给出。
GET从curl命令中删除并尝试。
curl -w "\n\n%{time_connect} + %{time_starttransfer} = %{time_total}\n" www.google.com
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7133 次 |
| 最近记录: |