(window:sg.Window)
| 21 | g_interval = 1 # how often to poll for CPU usage |
| 22 | |
| 23 | def 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 | |
| 31 | def main(): |
no test coverage detected