Measures execution time of Python functions using decorators.
Project description
timedfunc
An easy way to measure execution time of Python functions using decorators.
Installation
pip install timedfunc
Example
from timedfunc import timedfunc
@timedfunc
def my_function(x):
print("doing stuff that takes some time...")
import time
time.sleep((x + 1) * 0.100) # simulate a computation
for i in range(3):
my_function(i)
output:
doing stuff that takes some time...
doing stuff that takes some time...
doing stuff that takes some time...
--------------------------------+----------+--------------+--------------+--------------
timed functions | calls | min | mean | max
--------------------------------+----------+--------------+--------------+--------------
my_function | 3 | 0.111 s | 0.207 s | 0.310 s
--------------------------------+----------+--------------+--------------+--------------
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
timedfunc-1.1.2.tar.gz
(3.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file timedfunc-1.1.2.tar.gz.
File metadata
- Download URL: timedfunc-1.1.2.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.25.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20ca1ea5a49d7b7c2be43f194df3f40f504b5ea8016ec5b780e6cc90835e44ed
|
|
| MD5 |
871973adbac23bbf2ac5ebf27e4c8d1d
|
|
| BLAKE2b-256 |
52b1f9d8a0c81454866e2dece85b23d82aec6dbcc22d512b6bff2c283f15f655
|
File details
Details for the file timedfunc-1.1.2-py2.py3-none-any.whl.
File metadata
- Download URL: timedfunc-1.1.2-py2.py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.25.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b1d35a0c6ebeaf8e23be231d0e3472103f458325a4c886b7d13c032f15f0f52
|
|
| MD5 |
7d7da865f5ef5a4f94598d321cea3af3
|
|
| BLAKE2b-256 |
04e8bad14360e2bcd459a7c341704f3f6a383dd49d2fdd5990a087c643913507
|