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

Function CPU_thread

DemoPrograms/Demo_Desktop_Widget_CPU_Top_Processes.py:23–28  ·  view source on GitHub ↗
(window:sg.Window)

Source from the content-addressed store, hash-verified

21g_interval = 1 # how often to poll for CPU usage
22
23def CPU_thread(window:sg.Window):
24
25 while True:
26 cpu_percent = psutil.cpu_percent(interval=g_interval)
27 procs = psutil.process_iter()
28 window.write_event_value('-CPU UPDATE FROM THREAD-', (cpu_percent, procs))
29
30
31def main():

Callers 1

mainFunction · 0.70

Calls 1

write_event_valueMethod · 0.80

Tested by

no test coverage detected