使用elapsed获取响应时间
1、elapsed介绍
官方文档:http://cn.python-requests.org/zh_CN/latest/api.html?highlight=elapsed#requests.Response.elapsed
- 查看帮助:
import requests
test = requests.get('https://www.qq.com')
print(help(test.elapsed)) # 查看帮助
- 结果显示:
Help on timedelta object:
class timedelta(builtins.object)
| Difference between two datetime values.
|
| timedelta(days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0)
|
| All arguments are optional and default to 0.
| Arguments may be integers or floats, and may be positive or negative.
|
| Methods defined here:
|
| __abs__(self, /)
| abs(self)
|
| __add__(self, value, /)
| Return self+value.
|
| __bool__(self, /)
| self != 0
|
| __divmod__(self, value, /)
| Return d