Skip to main content

TimeRun is a Python library for elapsed time measurement.

Project description

TimeRun

TimeRun - Python library for elapsed time measurement.

License PyPI Latest Release Package Status Code style: black Imports: isort

TimeRun is a simple, yet elegant elapsed time measurement library for Python. It is distributed as a single file module and has no dependencies other than the Python Standard Library.

  • Elapsed Time: Customized time delta which represents elapsed time in nanoseconds.
  • Stopwatch: An elapsed time measurer with the highest available resolution.
  • Timer: Convenient syntax to capture measured elapsed time result and save it.

Setup

Prerequisites

The only prerequisite to use TimeRun is running Python 3.7+.

Installation

Install TimeRun from Python Package Index:

pip install timerun

Install TimeRun from Source Code:

python setup.py install

Quickstart

Measure Code Block

>>> from timerun import Timer
>>> with Timer() as timer:
...     pass  # put your code here
>>> print(timer.duration)
0:00:00.000000100

Measure Function

>>> from timerun import Timer
>>> timer = Timer()
>>> @timer
... def func():
...     pass  # put your code here
>>> func()
>>> print(timer.duration)
0:00:00.000000100

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

timerun-0.2.0.tar.gz (5.2 kB view hashes)

Uploaded Source

Built Distribution

timerun-0.2.0-py3-none-any.whl (5.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page