A function decorator/wrapper package to time a given function.
Project description
functimer
A function decorator/wrapper package to time a given function.
Contents
functimer/timer.py
: contains thetimer
decorator.functimer/util.py
: containsget_unit
function, parses the unit from given string following the format of0.0 ms
functimer/classes.py
: contains general classes and enums of package.
Installation
To install from PYPI:
pip install functimer
To manually install:
poetry build
pip install dist/*.whl
How to install Poetry.
Quick Example
Comprehensive Examples in examples
@timed(unit=Unit.second, number=1)
def timed_sleep(seconds):
sleep(seconds)
runtime = timed_sleep(0.3)
Tests
Run pytest
in the root directory of the repo.
License
MIT
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
functimer-1.0.0.tar.gz
(4.2 kB
view hashes)
Built Distribution
Close
Hashes for functimer-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5823f6a14f5e228d7672e35cd8dc591d3763e7f746b7fc48f62d8de162a2d1b |
|
MD5 | 61c53780805cc1c762b4426b781b26e6 |
|
BLAKE2b-256 | 0f62b38fb5b5e87623b7ae9b2bfc521d294dab7588bb20f0961d0c12d75db0a9 |