execspeed-0.1.0
توضیحات
Simple tool for finding average function execution time
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | execspeed-0.1.0 |
| نام | execspeed |
| نسخه کتابخانه | 0.1.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Ivan O'Connor |
| ایمیل نویسنده | ivanoconnor@hotmail.co.uk |
| آدرس صفحه اصلی | https://github.com/Astrochamp/speed |
| آدرس اینترنتی | https://pypi.org/project/execspeed/ |
| مجوز | - |
# PyExecSpeed
A simple package for calculating the execution time of a function in a Python file
## Usage:
### Installation
`pip install execspeed`
### Using
* `speed.showSpeed(function, r, <optional>, <extra>, <args>...)`
where `function` is any function from your Python file and `r` is the number of times to run it.
Prints average execution time.
* `speed.getSpeed(function, r, <optional>, <extra>, <args>...)`
again, `function` is any function from your Python file and `r` is the number of times to run it.
Returns average execution time as a float.
## Example:
```py
import speed
def myFunc(start, message):
x = start
for i in range(100):
x *= i
print(f"{message} {x}")
n = 10
speed.showSpeed(myFunc, n, 3, "Your number is:")
# Repeats myFunc n (= 10) times and prints the average execution time.
# Passed (3) and "Your number is:" to myFunc() -- any number of arguments can now be passed to your function this way
# A higher value of n will likely result in a more accurate value, but will take longer.
>>> 0.00003339
```
### Notes:
* The output from `getSpeed()` is a float.
* While `showSpeed()` or `getSpeed()` run a function, they block printing within that function so the terminal isn't filled with potentially hundreds of prints.
### [Create an issue](https://github.com/Astrochamp/speed/issues) if you have any feedback / bugs you want to report
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6 | Python |
نحوه نصب
نصب پکیج whl execspeed-0.1.0:
pip install execspeed-0.1.0.whl
نصب پکیج tar.gz execspeed-0.1.0:
pip install execspeed-0.1.0.tar.gz