MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / averageSpeed

Method averageSpeed

src/serverinfo.cpp:60–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60int ServerInfo::averageSpeed() const
61{
62 int count = 0;
63 int total = 0;
64
65 for (const auto& s : m_lastDownloads) {
66 if (s > 0) {
67 ++count;
68 total += s;
69 }
70 }
71
72 if (count > 0) {
73 return static_cast<double>(total) / count;
74 }
75
76 return 0;
77}
78
79void ServerInfo::addDownload(int bytesPerSecond)
80{

Callers 1

NexusSettingsTabMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected