aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zencore/stats.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/zencore/stats.cpp b/zencore/stats.cpp
index 47efba76b..6afd217e4 100644
--- a/zencore/stats.cpp
+++ b/zencore/stats.cpp
@@ -295,7 +295,14 @@ Histogram::Min() const
double
Histogram::Mean() const
{
- return double(m_Sum.load(std::memory_order_relaxed)) / m_Count;
+ if (m_Count)
+ {
+ return double(m_Sum.load(std::memory_order_relaxed)) / m_Count;
+ }
+ else
+ {
+ return 0.0;
+ }
}
uint64_t