如何使用cURL一次测量请求和响应时间?

旧城冷巷雨未停 提交于 2020-08-11 23:10:24

问题:

I have a web service that receives data in JSON format, processes the data, and then returns the result to the requester. 我有一个Web服务,它接收JSON格式的数据,处理数据,然后将结果返回给请求者。

I want to measure the request, response, and total time using cURL . 我想使用cURL测量请求,响应和总时间。

My example request looks like: 我的示例请求如下:

curl -X POST -d @file server:port

and I currently measure this using the time command in Linux: 我目前使用Linux中的time命令测量它:

time curl -X POST -d @file server:port

The time command only measures total time, though - which isn't quite what I am looking for. 时间命令只测量时间 - 这不是我想要的。

Is there any way to measure request and response times using cURL ? 有没有办法使用cURL来衡量请求和响应时间?


解决方案:

参考一: https://stackoom.com/question/1EQeb/如何使用cURL一次测量请求和响应时间
参考二: https://oldbug.net/q/1EQeb/How-do-I-measure-request-and-response-times-at-once-using-cURL
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!