A Simple Yet Convenient Timer module for Python 3
Project description
Simple Yet Convenient Timer for Python 3
Installation
pip install syct
Common Usage
Wrap a function with the @timer
function decorator:
from syct import timer
@timer
def test_timer_decorator():
sleep(5)
Calling the function will produce the following output:
<timestamp> - Started test_timer_decorator
<timestamp> - test_timer_decorator took 5.00 seconds to complete
Wrap a block of code using with Timer
:
from syct import Timer
with Timer("with Timer block"):
sleep(1)
sleep(1)
sleep(1)
sleep(1)
sleep(1)
Will produce the following output:
<timestamp> - Started with Timer block
<timestamp> - with Timer block took 5.00 seconds to complete
Create a custom Timer
object in your code:
from syct import Timer
timer_test = Timer("Timer Testing")
sleep(5)
timer_test.stop()
Will produce the following output:
<timestamp> - Started Timer Testing
<timestamp> - Timer Testing took 5.00 seconds to complete
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
syct-0.4.5.tar.gz
(4.0 kB
view details)
Built Distribution
syct-0.4.5-py3-none-any.whl
(3.8 kB
view details)
File details
Details for the file syct-0.4.5.tar.gz
.
File metadata
- Download URL: syct-0.4.5.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7da3c936e9be1c96f9c0ed5fcca85a8a36f1acfb85d5844433281d1b547d1386 |
|
MD5 | 8228e3bf45de5637df354639953fed70 |
|
BLAKE2b-256 | 17c282e1b3cbfd291437305bbcca4956a0bec76d5ca8b9ecb1d8e994062bccdf |
File details
Details for the file syct-0.4.5-py3-none-any.whl
.
File metadata
- Download URL: syct-0.4.5-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3708f142214f2dea4df87378166a2cea2ef290362893e7eecab9a80c18d18d84 |
|
MD5 | 727853b5f087564f673791ce4afa6ab8 |
|
BLAKE2b-256 | 4a82bc0ba7ab1ce14298be611ec261a42ac2f6ccfb2c536605138e2f2fddfa2b |