Skip to main content

timer.py

timer.py provides convenient functions to measure time in Python.

Installation

pip install timer.py

Usage

from time import sleep
from timer_py import Timer

timer = Timer()
timer.start()
# Or:
# timer = Timer(start=True)

# A one-second process
sleep(1)

# Printing the elapsed time. The timer will continue to run.
timer.elapsed()
# Output:
# [timer.py] 00:00:01.001

timer.pause()

# A one-second process that won't be counted while the timer is paused.
sleep(1)

timer.resume()

# Another one-second process.
sleep(1)

# Overriding the tag for one time only (the original tag will still be remembered).
timer.elapsed('Checkpoint 1')
# Output:
# [Checkpoint 1] 00:00:02.002

timer.set_tag('Custom title')

timer.restart()

# Another one-second process.
sleep(1)

# Storing the elapsed time to a variable as a float while hiding the output.
elapsed = timer.elapsed(print=False)
print(elapsed)
# Output:
# 00:00:01.001

timer.stop()
# Output:
# [Custom title] 00:00:01.001

Metadata

Release files for timer.py 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 timer.py 2.5.0
File Size Uploaded Provenance Actions
timer.py-2.5.0.tar.gz 15.1 kB Without provenance Details for timer.py-2.5.0.tar.gz

Built distribution (wheel)

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

Total release size: 31.1 kB

Release files / timer.py-2.5.0.tar.gz

Download URL timer.py-2.5.0.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
16c957d2e22f239aea0e7f19989749e987df131a1fa6a1522351a6fa5fc79545
BLAKE2b-256 checksum
How to use checksums
1bc79ad372500161e294791d031139ac1c124ff993190acfec4862449556acf3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / timer.py-2.5.0-py3-none-any.whl

Download URL timer.py-2.5.0-py3-none-any.whl
Size 16.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d2c6247cdc83914afd2e5d43ebc8493424151d19309ac71b248c9d47ec43bcb
BLAKE2b-256 checksum
How to use checksums
dc73594d84682e083a6f8c00c1fd7f87e9bf75926cb86472d59c15c649b724c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Security for timer.py 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