Browse Source

showbase: Start recording right away when opening PStats connection

Don't wait until the next frame - makes it harder to diagnose long load times in the new Timeline view
rdb 3 years ago
parent
commit
65ee79158f
1 changed files with 5 additions and 1 deletions
  1. 5 1
      direct/src/showbase/ShowBase.py

+ 5 - 1
direct/src/showbase/ShowBase.py

@@ -1930,7 +1930,11 @@ class ShowBase(DirectObject.DirectObject):
         if port is None:
         if port is None:
             port = -1
             port = -1
         PStatClient.connect(hostname, port)
         PStatClient.connect(hostname, port)
-        return PStatClient.isConnected()
+        if PStatClient.isConnected():
+            PStatClient.mainTick()
+            return True
+        else:
+            return False
 
 
     def addSfxManager(self, extraSfxManager):
     def addSfxManager(self, extraSfxManager):
         """
         """