Browse Source

Increase RemoteDebuggerPeerTCP poll to 6.9ms

Fix high CPU usage on MacOS by reverting the polling for Network
debugging to match 144hz refresh rate.
Will Whitty 3 years ago
parent
commit
c37bd41c79
1 changed files with 2 additions and 1 deletions
  1. 2 1
      core/debugger/remote_debugger_peer.cpp

+ 2 - 1
core/debugger/remote_debugger_peer.cpp

@@ -190,7 +190,8 @@ Error RemoteDebuggerPeerTCP::connect_to_host(const String &p_host, uint16_t p_po
 }
 }
 
 
 void RemoteDebuggerPeerTCP::_thread_func(void *p_ud) {
 void RemoteDebuggerPeerTCP::_thread_func(void *p_ud) {
-	const uint64_t min_tick = 100;
+	// Update in time for 144hz monitors
+	const uint64_t min_tick = 6900;
 	RemoteDebuggerPeerTCP *peer = (RemoteDebuggerPeerTCP *)p_ud;
 	RemoteDebuggerPeerTCP *peer = (RemoteDebuggerPeerTCP *)p_ud;
 	while (peer->running && peer->is_peer_connected()) {
 	while (peer->running && peer->is_peer_connected()) {
 		uint64_t ticks_usec = OS::get_singleton()->get_ticks_usec();
 		uint64_t ticks_usec = OS::get_singleton()->get_ticks_usec();