美文网首页
2020-05-12 curl -w 参数中time部分

2020-05-12 curl -w 参数中time部分

作者: 水泥中的鱼 | 来源:发表于2020-05-12 16:00 被阅读0次

curl --help 可以看到全部参数,我这次主要是 -w 中的time_部分( current version curl 7.68.0)

原文
time_appconnect The time, in seconds, it took from the start until the SSL/SSH/etc connect/handshake to the remote host was completed. (Added in 7.19.0)
time_connect The time, in seconds, it took from the start until the TCP connect to the remote host (or proxy) was completed.
time_namelookup The time, in seconds, it took from the start until the name resolving was completed.
time_pretransfer The time, in seconds, it took from the start until the file transfer was just about to begin.This includes all pre-transfer commands and negotiations that are specific to the particular protocol(s) involved.
time_redirect The time, in seconds, it took for all redirection steps including name lookup, connect, pretransfer and transfer before the final transaction was started. time_redirect shows the complete execu tion time for multiple redirections. (Added in 7.12.3)
time_starttransfer The time, in seconds, it took from the start un til the first byte was just about to be trans ferred. This includes time_pretransfer and also the time the server needed to calculate the re sult.
ime_total The total time, in seconds, that the full operation lasted.

翻译
time_appconnect 从开始到SSL/SSH/等连接/手摇完成到远程主机的时间,单位为秒。(7.19.0中新增) #ssl才会有,http的话为0
time_connect 从开始到TCP连接到远程主机(或代理)完成的时间,单位为秒。
time_namelookup 从开始到名称解析完成的时间,单位为秒。
time_pretransfer 从开始到文件传输即将开始所花的时间,单位为秒。
time_redirect 在最终事务开始之前,所有的重定向步骤,包括名称查询、连接、预传输和传输所花费的时间,单位为秒。 (新增于7.12.3)
time_starttransfer 时间_starttransfer 从开始到第一个字节即将被转发的时间,单位是秒。 这包括time_pretransfer和服务器计算结果所需的时间。
time_total 整个操作持续的总时间,单位为秒。

curl https://www.baidu.com -I -w 'time_namelookup:\t%{time_namelookup}\ntime_connect:\t%{time_connect}\ntime_total:\t%{time_total}\n'
HTTP/1.1 200 OK
Accept-Ranges: bytes
Cache-Control: private, no-cache, no-store, proxy-revalidate, no-transform
Connection: keep-alive
Content-Length: 277
Content-Type: text/html
Date: Tue, 12 May 2020 07:59:54 GMT
Etag: "575e1f5c-115"
Last-Modified: Mon, 13 Jun 2016 02:50:04 GMT
Pragma: no-cache
Server: bfe/1.0.8.18

time_namelookup:        0.026502
time_connect:   0.030562
time_total:     0.267953

相关文章

网友评论

      本文标题:2020-05-12 curl -w 参数中time部分

      本文链接:https://www.haomeiwen.com/subject/eogbnhtx.html