mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 19:08:55 -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
|
assert obj2count[4] == 4 * 3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bias=-1
|
bias=-1
|
||||||
def quickProfile(name="unnamed"):
|
def quickProfile(name="unnamed"):
|
||||||
global bias
|
global bias
|
||||||
if(base.config.GetBool("use-profiler",0)):
|
if(base.config.GetBool("use-profiler",0)):
|
||||||
print "Calibrating profiler"
|
print "Calibrating profiler"
|
||||||
if bias == -1:
|
if bias == -1:
|
||||||
prof.Profile.bias = prof.Profile().calibrate(10000)
|
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):
|
def profileDecorator(f):
|
||||||
if(not base.config.GetBool("use-profiler",0)):
|
if(not base.config.GetBool("use-profiler",0)):
|
||||||
return f
|
return f
|
||||||
|
Loading…
x
Reference in New Issue
Block a user