MCPcopy Index your code
hub / github.com/PySimpleGUI/PySimpleGUI / ping_thread

Function ping_thread

DemoPrograms/Demo_Graph_Element.py:31–39  ·  view source on GitHub ↗
(window: sg.Window)

Source from the content-addressed store, hash-verified

29
30
31def ping_thread(window: sg.Window):
32 while True:
33 if ping3:
34 ping_time = int(ping3.ping(ping_url) * 1000)
35 else:
36 time.sleep(.001)
37 ping_time = random.randint(0, 100)
38 if ping_time:
39 window.write_event_value('-THREAD-', ping_time)
40
41
42def main():

Callers 1

mainFunction · 0.70

Calls 1

write_event_valueMethod · 0.80

Tested by

no test coverage detected