gpt4 book ai didi

python-2.7 - pytest-timeit或pytest-benchmark在精度s上哪个更好?

转载 作者:行者123 更新时间:2023-12-03 17:15:54 27 4
gpt4 key购买 nike

我正在pytest中测试响应状态代码和flask-restful api的数据,现在我想测试这些端点花费的时间,我正在考虑pytest-timeit一个基准插件,有人知道哪个更准确吗?

最佳答案

pytest-benchmark是明确的选择。

您可以运行benchmark函数时间,并提供其运行时间的更详细的摘要。

您显然可以在timeit中手动进行此操作。但是,鉴于功能丰富且有据可查的benchmark功能,不值得花时间。

阅读更多有关基准here的信息。

关于python-2.7 - pytest-timeit或pytest-benchmark在精度s上哪个更好?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44476058/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com