Profile a function using a simple decorator
Project description
function_profile decorator
Provides decorator for time and memory profiling of functions.
Metrics:
time - time for a single function call
memory - peak memory used by the function. The peak memory is the difference between the starting minimum value, and the highest value.
Usage:
from function_profile import profile
@profile(time_prof=True, mem_prof=True)
def factoriel_loop(n: int) -> int:
"""Calculate factoriel non-recursive."""
fac: int = 1
for i in range(1, n + 1):
fac = fac * i
return fac
factoriel_loop(n=100)
Output:
factoriel_loop(, n=100)
Time 0.00001450
Memory 0.0546875
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for func-profile-decor-0.1.4-2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 029799d2d11af99d06007c9f5d385003699cd22ca350e070afdbf6deccd0e86e |
|
MD5 | 35abf174ccf75ef228afd75835ed591f |
|
BLAKE2b-256 | 79c44b48f4671f990b70e67ae1513021048863fd32676bc5a8de1257d5af64d8 |
Close
Hashes for func_profile_decor-0.1.4.post2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f0725486a8f913a488029f2373a0edf4fd5eb5b3c4a18fbfa9c4ab3c55d8535 |
|
MD5 | 692a47dc51972eb4ee9e65dc5f3b57a2 |
|
BLAKE2b-256 | b272932a8e51727a70786409b22e66a9223658c9cd8c8cfd32a58d30f1301fa7 |