A Context Manager and A Decorator for Measuring Execution Time
A simple context manager that measures time using perf_counter()
Installation
Install this via pip (or your favourite package manager):
pip install cm-time
Usage
from cm_time import timer
with timer() as t:
pass
print(t.elapsed)
Output:
Elapsed time: 0.000
0.0
from cm_time import timer_wrapped
@timer_wrapped()
def foo():
pass
Output:
foo: Elapsed time: 0.000
Contributors ✨
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
Credits
This package was created with Copier and the browniebroke/pypackage-template project template.
Metadata
Release files for cm-time 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cm_time-0.1.2.tar.gz | 7.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cm_time-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.6 kB
Release files / cm_time-0.1.2.tar.gz
| Download URL | cm_time-0.1.2.tar.gz |
|---|---|
| Size | 7.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e2848efc5868884d0a7795408ec9b2c21d2d3e2cf399241e8e4531a29128b638
|
|
BLAKE2b-256 checksum How to use checksums |
fbdbaef662a01ec5b855f1fa1ca969f5cf6489a2e7c83f38704426bdf8c6c1d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.9.6 readme-renderer/37.3 requests/2.28.2 requests-toolbelt/0.10.1 urllib3/1.26.15 tqdm/4.65.0 importlib-metadata/6.0.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.10
|
Release files / cm_time-0.1.2-py3-none-any.whl
| Download URL | cm_time-0.1.2-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8dfd172916a7b23f508fbca046157067ab9374fc38791d408278ce7288077cfa
|
|
BLAKE2b-256 checksum How to use checksums |
535f28ac6460fc9c67d4751200fffe56006c465663f7a1672793c6d8482b21e5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.9.6 readme-renderer/37.3 requests/2.28.2 requests-toolbelt/0.10.1 urllib3/1.26.15 tqdm/4.65.0 importlib-metadata/6.0.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.10.10
|