Forked from pratik-choudhari/scheduling_with_threads.py
Created
October 21, 2021 19:10
-
-
Save giridharmb/704bdf281fd9138736cbad96c7c234dd to your computer and use it in GitHub Desktop.
scheduling using threads
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| import threading | |
| def task(): | |
| print("Job Completed!") | |
| def schedule(): | |
| while 1: | |
| task() | |
| time.sleep(10) | |
| # makes our logic non blocking | |
| thread = threading.Thread(target=schedule) | |
| thread.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment