美文网首页
cURL打出请求详细时间

cURL打出请求详细时间

作者: phaker | 来源:发表于2018-11-06 17:05 被阅读0次

    新建format文件,内容根据需要自定

        time_namelookup:  %{time_namelookup}\n
           time_connect:  %{time_connect}\n
        time_appconnect:  %{time_appconnect}\n
       time_pretransfer:  %{time_pretransfer}\n
          time_redirect:  %{time_redirect}\n
     time_starttransfer:  %{time_starttransfer}\n
                        ----------\n
             time_total:  %{time_total}\n
    

    发送请求:

    curl -w "@curl-format.txt" -o /dev/null -s "http://www.baidu.com/"
    
    返回结果
        time_namelookup:  0.061
           time_connect:  0.092
        time_appconnect:  0.000
       time_pretransfer:  0.092
          time_redirect:  0.000
     time_starttransfer:  0.126
                        ----------
             time_total:  0.126
    
    原文:https://blog.josephscott.org/2011/10/14/timing-details-with-curl/

    相关文章

      网友评论

          本文标题:cURL打出请求详细时间

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