mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-10 11:28:27 +01:00
proper badnwidth calculation
This commit is contained in:
parent
708e17162c
commit
1e2f038ef5
1 changed files with 2 additions and 2 deletions
|
@ -190,8 +190,8 @@ namespace transport
|
||||||
auto delta = ts - m_LastBandwidthUpdateTime;
|
auto delta = ts - m_LastBandwidthUpdateTime;
|
||||||
if (delta > 0)
|
if (delta > 0)
|
||||||
{
|
{
|
||||||
m_InBandwidth = (m_TotalReceivedBytes - m_LastInBandwidthUpdateBytes)*1000/ts; // per second
|
m_InBandwidth = (m_TotalReceivedBytes - m_LastInBandwidthUpdateBytes)*1000/delta; // per second
|
||||||
m_OutBandwidth = (m_TotalSentBytes - m_LastOutBandwidthUpdateBytes)*1000/ts; // per second
|
m_OutBandwidth = (m_TotalSentBytes - m_LastOutBandwidthUpdateBytes)*1000/delta; // per second
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_LastBandwidthUpdateTime = ts;
|
m_LastBandwidthUpdateTime = ts;
|
||||||
|
|
Loading…
Add table
Reference in a new issue