mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
better profiling option
This commit is contained in:
parent
5d7d58a5bc
commit
582acfb7b9
@ -2954,13 +2954,19 @@ if __debug__:
|
||||
assert obj2count[4] == 4 * 3
|
||||
|
||||
|
||||
|
||||
bias=-1
|
||||
def quickProfile(name="unnamed"):
|
||||
def quickProfile(name="unnamed"):
|
||||
global bias
|
||||
if(base.config.GetBool("use-profiler",0)):
|
||||
print "Calibrating profiler"
|
||||
if bias == -1:
|
||||
prof.Profile.bias = prof.Profile().calibrate(10000)
|
||||
import pstats
|
||||
|
||||
def f8(x):
|
||||
return ("%"+"8.%df"%base.config.GetBool("profile-decimals",3)) % x
|
||||
pstats.f8=f8
|
||||
def profileDecorator(f):
|
||||
if(not base.config.GetBool("use-profiler",0)):
|
||||
return f
|
||||
|
Loading…
x
Reference in New Issue
Block a user