Small timing tool to run performance analysis
Project description
tepet
TEmporal PErformance Tool
25-cent term for a 5-cent concept!
What is this
tepet is a small utility to help you understand and track execution time of your code. You could write it anytime, but why do this every other day?
Usage
Can be used as a context manager
from tepet import PerfTimer
with PerfTimer():
print('doing stuff...')
# Output:
#
# > 2020 May 31 20:11:49 +0000 ==== started
# > doing stuff...
# > 2020 May 31 20:11:49 +0000 ==== elapsed 0.00000 seconds
and a function decorator
from tepet import PerfTimer
@PerfTimer()
def work():
print("working...")
work()
# Output:
#
# > 2020 May 31 20:14:25 +0000 ==== started
# > working...
# > 2020 May 31 20:14:25 +0000 ==== elapsed 0.00001 seconds
Also, can be used in production environments for naive tracking:
from tepet import Timer
def printer(seconds):
print(f'code block 1: {seconds:.5f} elapsed')
with Timer(printer):
...
# Output:
# > code block 1: 0.00000 elapsed
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
tepet-0.1.1.tar.gz
(5.5 kB
view details)
Built Distribution
tepet-0.1.1-py3-none-any.whl
(3.7 kB
view details)
File details
Details for the file tepet-0.1.1.tar.gz
.
File metadata
- Download URL: tepet-0.1.1.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.26.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | da27a74e8676785f43234b62f47cfa298ee64494e45805bd3955bd80bf5889e8 |
|
MD5 | bf4ffefbbff0ec562ccb34e833f32b67 |
|
BLAKE2b-256 | b1f629ddaf56b1b3f0fe3210f918e1c57498f7378528c797f634ed610e0fa84f |
File details
Details for the file tepet-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: tepet-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.26.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54ae13e574324a756d6abbe3a62fa95534f94f75473993fb167bf6139e8f29e8 |
|
MD5 | c6e8c184410d31da39bf275844f4bdfa |
|
BLAKE2b-256 | a84e825f1ae02b6274cbacb28b92e69774f86f41fc823fd129e5d41f07e1f4ef |