prevent division by zero

This commit is contained in:
Zlatin Balevsky
2019-06-06 07:09:05 +01:00
parent 5677d9f46a
commit fb8227a1f3

View File

@@ -195,7 +195,8 @@ class DownloadSession {
return reads[idx]
long interval = timestamps.last - timestamps[idx]
if (interval == 0)
interval = 0.001
for (int i = idx; i < SAMPLES; i++)
totalRead += reads[idx]
(int)(totalRead * 1000.0 / interval)