利用CRUL命令簡單分析請求細節所占用的時間吧
curl -o /dev/null -s -w %{http_code}:%{time_namelookup}:%{time_redirect}:%{time_pretransfer}:%{time_connect}:%{time_starttransfer}:%{time_total}:%{speed_download} www.baidu.com
這個例子是分析一次百度的請求各個參數:http狀態碼、DNS解析時間、重定向時間、從開始到准備傳輸的時間、TCP連接時間、開始傳輸時間、總時間、下載速度!
詳細的可以看CURL文檔:https://curl.haxx.se/docs/manpage.html