-
Notifications
You must be signed in to change notification settings - Fork 0
Home
PTymer is a Python package designed to help developers manage and monitor the runtime of their code. With features like timers and countdowns, it allows accurate measurement of execution times and setting time-based triggers.
Imagine you're developing a project and need to know how long a specific code snippet takes to execute. Or perhaps you want to run a function at a specific time. PTymer was created to solve these problems efficiently and in a user-friendly manner.
With PTymer, you can create a Timer object to measure the execution time of a code block. For example, you may want to know how long it takes to sort a large list. With PTymer, you can easily do this:
from ptymer import Timer
def sort_large_list(lst):
# Your sorting algorithm here
pass
large_list = list(range(1000000, 0, -1))
with Timer() as t:
sort_large_list(large_list)
print(f"The sorting took {t.elapsed} seconds")
In addition, PTymer allows you to create an Alarm object that executes a function at a specific time. For example, you may want to send yourself an email every day at 8 AM. With PTymer, you can easily do this:
from ptymer import Alarm
import datetime
import smtplib
def send_email():
# Your email sending code here
pass
alarm = Alarm(target=send_email, schedules=[datetime.time(hour=8)])
alarm.start()
These are just a few examples of what you can do with PTymer. Explore the documentation to discover more!
- 📖 Getting Started
- ⏱️ Timer
- ⏳ HourGlass
- ⏰ Alarm
⚠️ Handling Parallelism
Contributions are highly encouraged and welcomed! Whether you've encountered a bug that needs fixing, have a brilliant idea for a new feature, or simply want to improve the project, we invite you to open an issue or pull request. Your input drives our progress, making every contribution invaluable to us.
This project is governed by the MIT License, a permissive open-source license that allows you to freely use, modify, and distribute the software, subject to certain conditions. The essence of the MIT License lies in its simplicity and flexibility, granting you extensive rights to adapt the code to suit your needs without imposing significant restrictions. For comprehensive details regarding your rights and obligations, please refer to the LICENSE file included within this project.