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 hashes)
Built Distribution
Close
Hashes for timedfunc-1.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b1d35a0c6ebeaf8e23be231d0e3472103f458325a4c886b7d13c032f15f0f52 |
|
MD5 | 7d7da865f5ef5a4f94598d321cea3af3 |
|
BLAKE2b-256 | 04e8bad14360e2bcd459a7c341704f3f6a383dd49d2fdd5990a087c643913507 |