I want to a timer inside my python program, which keeps running while the program is running and once timer is over, it displays a message or performs an action like breaking a loop or continuing the loop.
2 Answers
You can use threads to execute a timer while the program is running. Here is a explanation to threads: https://realpython.com/intro-to-python-threading/
How can I time a code segment for testing performance with Pythons timeit?is not what Walnut street is asking.