Skip to main content

wraptimer

An amazing alternative to Python's builtin timeit module that allows for high resolution timing of functions as well as in-depth line-by-line timing. It also exposes convenient classes to measure execution time for any arbitrary code.

Sync function example

# imports
import time
from wraptimer import TimeIt
# Init
timeit = TimeIt()

# decorate
@timeit.byline
def test_by_line():
    a = 10
    b = 20
    time.sleep(0.8)
    c = a + b

    return [a, b, c]

# run
test_by_line()

Async function example

# Imports
import asyncio
from wraptimer import TimeIt
# Init
timeit = TimeIt()

# decorate
@timeit.byline
async def test_by_line_async():
    a = 10
    b = 20
    await asyncio.sleep(1.25)

    return [a, b]

# run
asyncio.run(test_by_line_async()) 

Don't need Line-by-line tracing?

Use @timeit.func if you do not want to print line-by-line durations.

...
@timeit.func
async def test_by_line_async():
    a = 10
    b = 20
    await asyncio.sleep(1.25)

    return [a, b]

Read the documentation

For more about wraptimer, Read The Documentation

Metadata

Release files for wraptimer 0.1.2

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

Source distribution (sdist)

Source distribution for wraptimer 0.1.2
File Size Uploaded Provenance Actions
wraptimer-0.1.2.tar.gz 5.2 kB Without provenance Details for wraptimer-0.1.2.tar.gz

Built distribution (wheel)

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

Total release size: 11.3 kB

Release files / wraptimer-0.1.2.tar.gz

Download URL wraptimer-0.1.2.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
678b4f0048675aa5bc7aa589ca174f216d930872b657148584e75e6bdc010af2
BLAKE2b-256 checksum
How to use checksums
72c4ad8bd17174fccdc51a9eef6dc6d944ed535cc5be251148089d49b84c00c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.8

Release files / wraptimer-0.1.2-py3-none-any.whl

Download URL wraptimer-0.1.2-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc07867e8deb791ad92814fb275a199d22932941b7f14b3721f52a9d58db8efa
BLAKE2b-256 checksum
How to use checksums
2a205cb3d57249437326b743d130dd3fc7c47d91e1b4c74f68e27eae188ad50c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.8

Security for wraptimer 0.1.2

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