Skip to content

feat: add context manager #2

@rhkarls

Description

@rhkarls

A context manager to time blocks of code, storing the results with some user passed identifier string

e.g.

with BenchmarkTimer("calculating something") as bt:
    a = calculate_something()
    b = a**2

prints something like Elapsed time to execute code block 'calculate something': 55 ms

bt stores the results, keeping the "calculating something" info, but its optional use as bt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions