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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for func_profile_decor-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d30884646a00a6543ffa21e046bcaaa1ad1e4f349dd96d8fc2fc6e35c6ecc589 |
|
MD5 | 7a5f8fe58fae029140b1d0f117b1147b |
|
BLAKE2b-256 | b6d54051b05c80fa3c4b68f6555d89ec88c787f7a7be4ab017c2053f327f5d6c |