MCPcopy Create free account
hub / github.com/arvidn/libtorrent / update_counters

Method update_counters

examples/session_view.cpp:147–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147void session_view::update_counters(span<std::int64_t const> stats_counters
148 , lt::clock_type::time_point const t)
149{
150 // only update the previous counters if there's been enough
151 // time since it was last updated
152 if (t - m_timestamp[1] > lt::seconds(2))
153 {
154 m_cnt[1].swap(m_cnt[0]);
155 m_timestamp[1] = m_timestamp[0];
156 }
157
158 m_cnt[0].assign(stats_counters.begin(), stats_counters.end());
159 m_timestamp[0] = t;
160 render();
161}
162

Callers 1

client_test.cppFile · 0.80

Calls 5

renderFunction · 0.85
swapMethod · 0.45
assignMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected