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-1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0464e26d147b33cde1ea0750ba7d960be57add66071e8fac64cfb5520651ab95 |
|
MD5 | da44292f1937b52810adb1a727291ea2 |
|
BLAKE2b-256 | d2d787a97d718cf2d402d9093722aca208fb71d10c2e3bfac58b418398a1ab43 |
Close
Hashes for func_profile_decor-0.1.4.post1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23981be227dcc2bf31449db26839399bdce663aff1b93fc52792673dea23b066 |
|
MD5 | 0eef60ea33a2a8dd452587cca3bef6ee |
|
BLAKE2b-256 | 7afce0fb45a5c5052b3e24709f285b8d7f4ce10349fdbb08cdb99f1f06896cfa |