profiling is cordoned off

This commit is contained in:
Zachary Pavlov 2007-06-28 22:45:10 +00:00
parent 7d8ec647e4
commit 7177c38580

View File

@ -32,7 +32,6 @@ import EventManager
import math,sys,os
import Loader
import time
import profile, pstats
from direct.fsm import ClassicFSM
from direct.fsm import State
import DirectObject
@ -116,13 +115,14 @@ class ShowBase(DirectObject.DirectObject):
# has to run before libpanda is even loaded).
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
# aspect ratio from the window size.