mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 09:23:03 -04:00
fix for div-by-zero in task duration warning
This commit is contained in:
parent
8c2e657f15
commit
77cfda8691
@ -753,7 +753,9 @@ class TaskManager:
|
||||
|
||||
# warn if the task took too long
|
||||
if self.warnTaskDuration and self.globalClock:
|
||||
avgFrameDur = (1. / self.globalClock.getAverageFrameRate())
|
||||
avgFrameRate = self.globalClock.getAverageFrameRate()
|
||||
if avgFrameRate > .00001:
|
||||
avgFrameDur = (1. / avgFrameRate)
|
||||
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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user