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.
closed as off-topic by lenik, Piotr Kula, Jivings May 1 '14 at 16:21
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "This question does not appear to be specific to the Raspberry Pi within the scope defined in the help center." – lenik, Piotr Kula, Jivings