summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2018-09-24 09:27:01 +0200
committerJulian Andres Klode <julian.klode@canonical.com>2018-09-24 09:27:01 +0200
commit089e627153781ae7c320a5a0724c6c70d684b689 (patch)
treea81d91159ac8455bca21d3386a2b4e3d547a894a /apt-pkg
parente78844ba89fd15879333c1394fae9a65acebedc0 (diff)
Fix calculation of elapsed usec in downloads
A recent change to use chronos inadvertently replaced the difference of new usec - old usec with new sec - old usec, which is obviously wrong.
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/acquire.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc
index 0fee80c5d..541785b03 100644
--- a/apt-pkg/acquire.cc
+++ b/apt-pkg/acquire.cc
@@ -1329,7 +1329,7 @@ bool pkgAcquireStatus::Pulse(pkgAcquire *Owner)
{
std::chrono::duration<double> Delta =
std::chrono::seconds(NewTime.tv_sec - Time.tv_sec) +
- std::chrono::microseconds(NewTime.tv_sec - Time.tv_usec);
+ std::chrono::microseconds(NewTime.tv_usec - Time.tv_usec);
// Compute the CPS value
if (Delta < std::chrono::milliseconds(10))
@@ -1423,7 +1423,7 @@ void pkgAcquireStatus::Stop()
std::chrono::duration<double> Delta =
std::chrono::seconds(NewTime.tv_sec - StartTime.tv_sec) +
- std::chrono::microseconds(NewTime.tv_sec - StartTime.tv_usec);
+ std::chrono::microseconds(NewTime.tv_usec - StartTime.tv_usec);
// Compute the CPS value
if (Delta < std::chrono::milliseconds(10))