From 84e987ee8f9f7a326093da669cf02ad653290dfe Mon Sep 17 00:00:00 2001 From: Brendan Haines Date: Mon, 2 Mar 2020 16:11:21 -0700 Subject: [PATCH] make data fetch happen in a second thread --- Software/python/hwtest.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Software/python/hwtest.py b/Software/python/hwtest.py index 9020399..9ec0cfc 100644 --- a/Software/python/hwtest.py +++ b/Software/python/hwtest.py @@ -82,7 +82,12 @@ curdoc().add_root(row(controls, plot, width=800)) # curdoc().add_root(row(plot, width=800)) curdoc().title = "test" -t = threading.timer(0.5,update_data) +def control_thread(): + while True: + time.sleep(0.01) + update_data() + +t = threading.Thread(target=control_thread) t.start() # while True: # time.sleep(0.1)