Simple python decorators for measuring function execution times.
pip install cutimefrom cutime import gettime, avgtime, sumtime
@gettime
def hello():
print("Hello World!")
hello()This will build and test this package through Test PyPI and PyPI. I will make packages under the links Test PyPI and PyPI In the same directory as setup.py, run:
pip install build
python -m buildpip install hatch twinehatch buildpython -m twine upload --repository testpypi dist/*pip install -i https://test.pypi.org/simple/ cutimepython -m twine upload dist/*| Category | Ideas |
|---|---|
| Better output control | Add options for logging results to file, CSV, or JSON. |
| Context manager support | Add with syntax to measure arbitrary code blocks. |
| Pretty printing | Use tabulate or rich for formatted terminal output. |
| Statistical summaries | Track mean, median, std deviation across runs. |
| Async support | Add timing decorators for async def functions. |
| Profiling integration | Integrate with Python’s cProfile or timeit. |
| Custom reporting hooks | Allow users to supply callbacks for each timing. |
| Area | Expansion |
|---|---|
| CLI tool | Add a command-line utility: python -m cutime script.py |
| Docs site | Add documentation via MkDocs or Sphinx |
| Tests | Add pytest-based test suite |
| Badges | Add shields.io badges (version, license, PyPI) |