mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-23 11:30:15 +10:00
[WIP] GUI: Reduce CPU usage by adding sleep intervals to UI wait loops
Fix issue where the GUI main thread was consuming excessive CPU while waiting for background tasks to complete. By adding a configurable sleep interval between UI updates, CPU usage is significantly reduced while maintaining responsiveness. - Add thread_sleep_interval constant to global Constants class - Implement wait_for_thread utility function in gui_support - Update all wxPython event loops to use the new helper - Test shows approximately 60% CPU usage reduction during waits
This commit is contained in:
@@ -130,7 +130,7 @@ class OpenCoreLegacyPatcher:
|
||||
|
||||
if not any(x in sys.argv for x in ignore_args):
|
||||
while self.constants.unpack_thread.is_alive():
|
||||
time.sleep(0.1)
|
||||
time.sleep(self.constants.thread_sleep_interval)
|
||||
|
||||
arguments.arguments(self.constants)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user