php - Guzzle 6 - 获取请求总时间

标签 php curl guzzle guzzle6

我正在搜索 Guzzle 6 中的请求总时间,就在一个简单的 GET 请求之后:

$client = new GuzzleHttp\Client();
$response = client->get('http://www.google.com/');

但是在文档中找不到任何相关内容。有什么想法吗?

非常感谢。

最佳答案

在 Guzzle 6.1.0 中,您可以使用“on_stats”请求选项来获取传输时间等。

更多信息可以在 Request Options - on_stats 找到

https://github.com/guzzle/guzzle/releases/tag/6.1.0

关于php - Guzzle 6 - 获取请求总时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31341254/

相关文章:

PHP连接但无法选择数据库

php - PHP 中的散列以使用安全密码登录

php - codeigniter is_unique 数据库设置

google-chrome - Chrome忽略本地主机子域的主机文件

javascript - 使用 XMLHTTP JavaScript 通过 cURL PHP 接收参数

php - guzzlehttp 在 Laravel 项目上抛出错误 - strtolower() : Argument #1 ($string) must be of type string, int 给出

php - 在进行下拉选择之前隐藏字段的搜索框

php - AWS PHP SDK v3 中的响应日志记录

php - 从 Guzzle 中捕获 ConnectException

curl - 使用 jmeter 测试 curl 请求