Skip to main content

noiftimer

Simple timer class to track elapsed time.
Install with:

pip install noiftimer

Usage:

from noiftimer import Timer, time_it, log_time
import time

Timer object:

>>> def very_complicated_function():
...     time.sleep(1)
...
>>> timer = Timer()
>>> for _ in range(10):
...     timer.start()
...     very_complicated_function()
...     timer.stop()
...
>>> print(timer.stats)
elapsed time: 1s 1ms 173us
average elapsed time: 1s 912us
>>> timer.elapsed
1.001173496246338
>>> timer.elapsed_str
'1s 1ms 173us'
>>> timer.average_elapsed
1.0009121656417848
>>> timer.average_elapsed_str
'1s 912us'

time_it decorator (executes the decorated function 10 times)

>>> @time_it(10)
... def very_complicated_function():
...     time.sleep(1)
...
>>> very_complicated_function()
very_complicated_function average execution time: 1s 469us

Alternatively, the log_time decorator can be used to instead log the execution time to a file.

Metadata

Release files for noiftimer 2.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for noiftimer 2.5.0
File Size Uploaded Provenance Actions
noiftimer-2.5.0.tar.gz 4.6 kB Without provenance Details for noiftimer-2.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for noiftimer 2.5.0
File Interpreter ABI Platform Actions
noiftimer-2.5.0-py3-none-any.whl Python 3 none any Details for noiftimer-2.5.0-py3-none-any.whl

Total release size: 10.5 kB

Release files / noiftimer-2.5.0.tar.gz

Download URL noiftimer-2.5.0.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1ec7311aa79ccc5f85b3d1d7b822122b3a7fa7f56ea4229ed0c8fd7fafecadcc
BLAKE2b-256 checksum
How to use checksums
30f320bb6c096478354af0308d6ca693d5aa34364d04e7bcc858ce6b5344216f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.0

Release files / noiftimer-2.5.0-py3-none-any.whl

Download URL noiftimer-2.5.0-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ec34e7826a0008a29ff67ed62fe547d88f2146acddf5924a0283aa4177b01e4
BLAKE2b-256 checksum
How to use checksums
9bc0ace39a12a2d80fb5f45e5af1899b21c725fdc83f215d9d077addec18a931
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.0

Security for noiftimer 2.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page