mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
fix for div-by-zero in task duration warning
This commit is contained in:
parent
8c2e657f15
commit
77cfda8691
@ -753,10 +753,12 @@ class TaskManager:
|
|||||||
|
|
||||||
# warn if the task took too long
|
# warn if the task took too long
|
||||||
if self.warnTaskDuration and self.globalClock:
|
if self.warnTaskDuration and self.globalClock:
|
||||||
avgFrameDur = (1. / self.globalClock.getAverageFrameRate())
|
avgFrameRate = self.globalClock.getAverageFrameRate()
|
||||||
if dt >= (self.taskDurationWarningThreshold * avgFrameDur):
|
if avgFrameRate > .00001:
|
||||||
assert TaskManager.notify.warning('frame %s: task %s ran for %.2f seconds, avg frame duration=%.2f seconds' % (
|
avgFrameDur = (1. / avgFrameRate)
|
||||||
globalClock.getFrameCount(), task.name, dt, avgFrameDur))
|
if dt >= (self.taskDurationWarningThreshold * avgFrameDur):
|
||||||
|
assert TaskManager.notify.warning('frame %s: task %s ran for %.2f seconds, avg frame duration=%.2f seconds' % (
|
||||||
|
globalClock.getFrameCount(), task.name, dt, avgFrameDur))
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user