diff --git a/src/xswiftbus/service.cpp b/src/xswiftbus/service.cpp index 16f2fcbdc..07cc4fb1b 100644 --- a/src/xswiftbus/service.cpp +++ b/src/xswiftbus/service.cpp @@ -29,6 +29,7 @@ namespace XSwiftBus { DataRef m_thisFramePeriod; DataRef m_thisFramePeriodXP11; + DataRef m_secondsSinceReset; DataRef m_groundSpeed; std::vector m_samples; @@ -78,11 +79,14 @@ namespace XSwiftBus if (current > c_framePeriodBudget) { m_totalOverBudget += current - c_framePeriodBudget; - } - const float metersShort = m_groundSpeed.get() * std::max(0.0f, current - c_framePeriodBudget); - m_totalMetersShort += metersShort; - if (m_groundSpeed.get() > 1.0f) { m_totalSecondsLate += std::max(0.0f, current - c_framePeriodBudget); } + if (m_secondsSinceReset.get() > 10) + { + const float metersShort = m_groundSpeed.get() * std::max(0.0f, current - c_framePeriodBudget); + m_totalMetersShort += metersShort; + if (m_groundSpeed.get() > 1.0f) { m_totalSecondsLate += std::max(0.0f, current - c_framePeriodBudget); } + } + } } };