Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'base/time_samples.cpp')
-rw-r--r--base/time_samples.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/base/time_samples.cpp b/base/time_samples.cpp
index 3a0d439e18..209385b060 100644
--- a/base/time_samples.cpp
+++ b/base/time_samples.cpp
@@ -4,21 +4,21 @@
namespace my
{
-void TimeSamples::Add(double s)
+void TimeSamples::Add(double seconds)
{
- m_s += s;
- m_s2 += s * s;
+ m_sum += seconds;
+ m_sum2 += seconds * seconds;
++m_total;
}
-double TimeSamples::GetMean() const { return m_total == 0 ? 0.0 : m_s / m_total; }
+double TimeSamples::GetMean() const { return m_total == 0 ? 0.0 : m_sum / m_total; }
-double TimeSamples::GetSd() const
+double TimeSamples::GetSD() const
{
if (m_total < 2)
return 0.0;
- return std::max((m_s2 - m_s * m_s / static_cast<double>(m_total)) / (m_total - 1), 0.0);
+ return std::max((m_sum2 - m_sum * m_sum / static_cast<double>(m_total)) / (m_total - 1), 0.0);
}
-double TimeSamples::GetVar() const { return sqrt(GetSd()); }
+double TimeSamples::GetVar() const { return sqrt(GetSD()); }
} // namespace my