Dear Experts:
I am writing one test program with Python which is running multiple threads in parallel. I hope to add another thread to display the test status every 10 seconds. Could you please tell me how I can schedule a task to run every 10 seconds in Python?
I defined one function return_status() and tried the Timer object of threading as follows, but it only run once after 10 seconds. I hope it can run multiple times and invoke every 10 seconds.
Thank you very much in advance!
Regards,
Haiyan
I am writing one test program with Python which is running multiple threads in parallel. I hope to add another thread to display the test status every 10 seconds. Could you please tell me how I can schedule a task to run every 10 seconds in Python?
I defined one function return_status() and tried the Timer object of threading as follows, but it only run once after 10 seconds. I hope it can run multiple times and invoke every 10 seconds.
Code:
running_status = threading.Timer(10, self.return_status) # return test status every 10 seconds running_status.start()
Regards,
Haiyan