private NetConnectionStatistics GetCurrentWindow(double now)
{
if (m_currentWindow == null)
{
return(null);
}
if (now - m_currentWindow.m_startTimestamp >= m_windowSize)
{
// close this window and open new (actually, flip and reset)
NetConnectionStatistics tmp = m_previousWindow;
m_previousWindow = m_currentWindow;
m_previousWindow.m_totalTimeSpan = (float)(now - m_previousWindow.m_startTimestamp);
m_currentWindow = tmp;
m_currentWindow.Reset(now);
}
return(m_currentWindow);
}