feat(net): %netspeed% token to show combined up+download speed (#2590)

Closes #1083 

* Add netspeed parameter (#1083)

* Update net.cpp

* Update net.hpp

* Update network.cpp

* Update CHANGELOG.md
This commit is contained in:
Prateek Sunal
2022-02-07 01:42:38 +05:30
committed by GitHub
parent a33e8de922
commit ab915fb724
4 changed files with 13 additions and 0 deletions

View File

@ -274,6 +274,15 @@ namespace net {
float bytes_diff = m_status.current.transmitted - m_status.previous.transmitted;
return format_speedrate(bytes_diff, minwidth, unit);
}
/**
* Get total net speed rate
*/
string network::netspeed(int minwidth, const string& unit) const {
float bytes_diff = m_status.current.received - m_status.previous.received
+ m_status.current.transmitted - m_status.previous.transmitted;
return format_speedrate(bytes_diff, minwidth, unit);
}
/**
* Set if unknown counts as up