Socket
Book a DemoInstallSign in
Socket

timerun

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

timerun

TimeRun is a Python library for elapsed time measurement.

pipPyPI
Version
0.2.0
Maintainers
1

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 and save measured elapsed time results

Setup

Prerequisites

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

Installation

Install TimeRun from Python Package Index:

pip install timerun

Install TimeRun from Source Code:

pip install git+https://github.com/HH-MWB/timerun.git

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

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines on how to contribute to this project.

License

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

Keywords

time

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts