diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:22:55 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:22:55 +0200 |
commit | c4182431ac7d9d306fdd2267e082fa4cec6fec2c (patch) | |
tree | 865cca543c062b7af2586f85cee19f9af4e7614d /lib/perf_check.cpp | |
parent | 5.11 (diff) | |
download | FreeFileSync-c4182431ac7d9d306fdd2267e082fa4cec6fec2c.tar.gz FreeFileSync-c4182431ac7d9d306fdd2267e082fa4cec6fec2c.tar.bz2 FreeFileSync-c4182431ac7d9d306fdd2267e082fa4cec6fec2c.zip |
5.12
Diffstat (limited to 'lib/perf_check.cpp')
-rw-r--r-- | lib/perf_check.cpp | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/lib/perf_check.cpp b/lib/perf_check.cpp index c6a4e2d1..85a98910 100644 --- a/lib/perf_check.cpp +++ b/lib/perf_check.cpp @@ -98,34 +98,13 @@ wxString PerfCheck::getBytesPerSecond() const const double timeDelta = recordBack.first - recordFront.first; const double dataDelta = recordBack.second.data_ - recordFront.second.data_; - if (!numeric::isNull(timeDelta)) - if (dataDelta > 0) //may be negative if user cancels copying + if (!numeric::isNull(timeDelta) && dataDelta > 0) return filesizeToShortString(zen::Int64(dataDelta * 1000 / timeDelta)) + _("/sec"); } return L"-"; //fallback } -wxString PerfCheck::getOverallBytesPerSecond() const //for all samples -{ - warn_static("WTF!? tihs considers window only!") - - if (!samples.empty()) - { - const auto& recordBack = *samples.rbegin(); - const auto& recordFront = *samples.begin(); - //----------------------------------------------------------------------------------------------- - const double timeDelta = recordBack.first - recordFront.first; - const double dataDelta = recordBack.second.data_ - recordFront.second.data_; - - if (!numeric::isNull(timeDelta)) - if (dataDelta > 0) //may be negative if user cancels copying - return zen::filesizeToShortString(zen::Int64(dataDelta * 1000 / timeDelta)) + _("/sec"); - } - return L"-"; //fallback -} - - /* class for calculation of remaining time: ---------------------------------------- |