mirror of
https://github.com/yse/easy_profiler.git
synced 2024-12-27 00:31:02 +08:00
[ui] fixed zero division error
This commit is contained in:
parent
272c0ceab1
commit
357ac45834
@ -835,8 +835,11 @@ void GraphicsHistogramItem::setSource(profiler::thread_id_t _thread_id, profiler
|
||||
}
|
||||
}
|
||||
|
||||
m_avgDuration = m_blockTotalDuraion / totalCount;
|
||||
m_medianDuration = profiler_gui::calculateMedian(durations);
|
||||
if (totalCount != 0)
|
||||
{
|
||||
m_avgDuration = m_blockTotalDuraion / totalCount;
|
||||
m_medianDuration = profiler_gui::calculateMedian(durations);
|
||||
}
|
||||
|
||||
m_medianDurationFull = m_medianDuration;
|
||||
m_avgDurationFull = m_avgDuration;
|
||||
@ -1528,7 +1531,7 @@ void GraphicsHistogramItem::updateImageAsync(QRectF _boundingRect, HistRegime _r
|
||||
m_workerTopDuration = _top_duration;
|
||||
m_workerBottomDuration = _bottom_duration;
|
||||
|
||||
if (_bindMode)
|
||||
if (_bindMode && totalCount != 0)
|
||||
{
|
||||
m_workerAvgDuration /= totalCount;
|
||||
m_workerMedianDuration = profiler_gui::calculateMedian(durations);
|
||||
|
Loading…
x
Reference in New Issue
Block a user