跳转到主要内容

最好的Python速度测试库和命令行工具

项目描述

sloth

python速度测试库和命令行工具

codecov Build Status Codacy Badge License: MIT Contributors Last Commit Documentation Status

sloth是一个Python包,用于以尽可能少的代码进行Python代码和函数的速度测试。它易于使用,并且与许多项目不同,拥有相当不错的文档。

这个API背后的想法是

>>> from sloth import compare_sloth
>>> import timeit
>>> compare_sloth(timeit)
'sloth is loads better than timeit!'

看?在3行中描述。 一切 timeit能做的,sloth都能做得更好——或者很快就能做到。而且很多 timeit 做不到的事情,sloth也能做到。

快速示例

>>> from sloth.simple import time_callable
>>> import time
>>> def my_func(a, b, c):
...     time.sleep(1)
...     print(a, b, c)
>>> time_callable(my_func, 2, 'a', 'b', 'c')
a b c
1.000063419342041

安装

您可以使用pip安装sloth

pip install sloth-speedtest

请参阅文档以获取更多信息。

链接

请注意,此库与https://sloth.readthedocs.io上的库无关且互斥。

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源代码分发

sloth-speedtest-0.2.post1.tar.gz (7.1 kB 查看哈希值)

上传时间 源代码

构建分发

sloth_speedtest-0.2.post1-py3-none-any.whl (11.3 kB 查看哈希值)

上传时间 Python 3

支持者

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面