- 新建一个
curl-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
- 执行请求
Linux/unix
curl -w "@curl-format" -o /dev/null -s "https://oschina.com/"
Windows
curl -w "@curl-format" -o /dev/null -s "https://oschina.com/"
命令参数解释 -w "@curl-formatt" cURL输出指定格式 -o /dev/null 重定向请求结果到 /dev/null -s cURL 不展示进度
响应结果
time_namelookup: 0.000000 time_connect: 0.000000 time_appconnect: 0.000000 time_pretransfer: 0.000000 time_redirect: 0.000000 time_starttransfer: 0.000000 ---------- time_total: 0.257694
参考地址: