No project description provided
Project description
Simple Timing
Installation
pip install simpletiming
Usage
As decorator
from simpletiming import Timer
from time import sleep
@Timer(name="Potato")
def potato():
sleep(1)
potato()
# Elapsed time: 1.0011 seconds
As object
timer = Timer()
timer.start()
sleep(1)
timer.stop()
# Elapsed time 1.0011 seconds
As context manager
with Timer(message="Elapsed time: {minutes:0.4f} minutes"):
sleep(1)
# Elapsed time: 0.0167 minutes
On all class methods
@Timer(name="MyClass", message="{name}: {seconds:0.4f} seconds")
class MyClass:
def potato(self):
sleep(1)
obj = MyClass()
obj.potato()
# MyClass: 1.0011 seconds
License
This project is licensed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
simpletiming-0.1.1.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for simpletiming-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e95f6d8f7042048ffbd803b06d6149a981bd535abc85397667ade9e50d297cd |
|
MD5 | 15bf78098465b4dbebced4f51264b537 |
|
BLAKE2b-256 | 6abb41cabaf7ad2137b426a1d796a1aaf0b7ffbc6b1aa785830aa7be7f1cf293 |