Browse Source

profiling is cordoned off

Zachary Pavlov 18 years ago
parent
commit
7177c38580
1 changed files with 7 additions and 7 deletions
  1. 7 7
      direct/src/showbase/ShowBase.py

+ 7 - 7
direct/src/showbase/ShowBase.py

@@ -32,7 +32,6 @@ import EventManager
 import math,sys,os
 import math,sys,os
 import Loader
 import Loader
 import time
 import time
-import profile, pstats
 from direct.fsm import ClassicFSM
 from direct.fsm import ClassicFSM
 from direct.fsm import State
 from direct.fsm import State
 import DirectObject
 import DirectObject
@@ -116,13 +115,14 @@ class ShowBase(DirectObject.DirectObject):
         # has to run before libpanda is even loaded).
         # has to run before libpanda is even loaded).
         taskMgr.resumeFunc = PStatClient.resumeAfterPause
         taskMgr.resumeFunc = PStatClient.resumeAfterPause
 
 
-        
-        profile.Profile.bias = float(self.config.GetString("profile-bias","0"))
-        
+        if(self.config.GetBool("want-dev",0)):
+            import profile, pstats        
+            profile.Profile.bias = float(self.config.GetString("profile-bias","0"))
+            
                
                
-        def f8(x):
-            return ("%"+"8.%df"%base.config.GetInt("profile-decimals",3)) % x
-        pstats.f8=f8
+            def f8(x):
+                return ("%"+"8.%df"%base.config.GetInt("profile-decimals",3)) % x
+            pstats.f8=f8
 
 
         # If the aspect ratio is 0 or None, it means to infer the
         # If the aspect ratio is 0 or None, it means to infer the
         # aspect ratio from the window size.
         # aspect ratio from the window size.