I would like to add a timing feature into my python code. I have a situation where data reading occurs continuously and rapidly. How do I implement a timing system to stop reading after a period of time? Time.sleep() doesn't help in this case as it only pauses the program for a certain period of time. What I need to implement is to force stop the program (stop reading/close file) after a certain period of time. Any help is much appreciated.