Change the algorithm that calculates the average copy speed, so it begins to
display much earlier (two seconds). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35131 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -783,16 +783,15 @@ BStatusView::UpdateStatus(const char *curItem, off_t itemSize, bool optional)
|
|||||||
fLastSpeedReferenceSize = fSizeProcessed;
|
fLastSpeedReferenceSize = fSizeProcessed;
|
||||||
fLastSpeedReferenceTime = currentTime;
|
fLastSpeedReferenceTime = currentTime;
|
||||||
fBytesPerSecond = 0.0;
|
fBytesPerSecond = 0.0;
|
||||||
|
size_t count = 0;
|
||||||
for (size_t i = 0; i < kBytesPerSecondSlots; i++) {
|
for (size_t i = 0; i < kBytesPerSecondSlots; i++) {
|
||||||
if (fBytesPerSecondSlot[i] != 0.0)
|
if (fBytesPerSecondSlot[i] != 0.0) {
|
||||||
fBytesPerSecond += fBytesPerSecondSlot[i];
|
fBytesPerSecond += fBytesPerSecondSlot[i];
|
||||||
else {
|
count++;
|
||||||
fBytesPerSecond = 0.0;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (fBytesPerSecond != 0.0)
|
if (count > 0)
|
||||||
fBytesPerSecond /= kBytesPerSecondSlots;
|
fBytesPerSecond /= count;
|
||||||
Invalidate();
|
Invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user