summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gc/gcee.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gc/gcee.cpp b/src/gc/gcee.cpp
index e8bbdfa952..c75ba9bb23 100644
--- a/src/gc/gcee.cpp
+++ b/src/gc/gcee.cpp
@@ -223,8 +223,11 @@ void GCHeap::UpdatePostGCCounters()
}
// Update percent time spent in GC
- g_percentTimeInGCSinceLastGC = (int)(g_TotalTimeInGC * 100 / _timeInGCBase);
+ if (_timeInGCBase != 0)
+ g_percentTimeInGCSinceLastGC = (int)(g_TotalTimeInGC * 100 / _timeInGCBase);
+ else
+ g_percentTimeInGCSinceLastGC = 0;
g_TotalTimeSinceLastGCEnd = _currentPerfCounterTimer;
}