| 384 | } |
| 385 | |
| 386 | float NetworkSink::ComputeCurrentSpeed() |
| 387 | { |
| 388 | if (m_speedTimer.ElapsedTime() > 1000) |
| 389 | { |
| 390 | m_currentSpeed = m_byteCountSinceLastTimerReset * 1000 / m_speedTimer.ElapsedTime(); |
| 391 | m_maxObservedSpeed = STDMAX(m_currentSpeed, m_maxObservedSpeed * 0.98f); |
| 392 | m_byteCountSinceLastTimerReset = 0; |
| 393 | m_speedTimer.StartTimer(); |
| 394 | // OutputDebugString(("max speed: " + IntToString((int)m_maxObservedSpeed) + " current speed: " + IntToString((int)m_currentSpeed) + "\n").c_str()); |
| 395 | } |
| 396 | return m_currentSpeed; |
| 397 | } |
| 398 | |
| 399 | float NetworkSink::GetMaxObservedSpeed() const |
| 400 | { |
nothing calls this directly
no test coverage detected