Probably the simplest time profiling in python
pip install timefile
To time your functions simply import watch
like this:
from timefile import watch
import time
@watch
def o_one(n):
time.sleep(n/10**4)
@watch
def o_two(m):
time.sleep(m**2/10**4)
for i in range(10):
o_one(i)
o_two(i)
Check out the plots saved in the timefiles/plots/ directory for visualizations of the runtime.
I warmly welcome any contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas. Feel free to create issues or pull requests at the timefile GitHub.
- Tests !!!
- Documentation
- Small fixes / cleanup
- Performance improvements
- Prettier plots
- Multivariable plots?
- Simple regression or analysis?
This package is designed for simple runtime insights and is not optmized for performance. For more comprehensive profiling in Python, consider using more robust tools like cProfile, timeit, line_profiler, etc.