MCPcopy Create free account
hub / github.com/chrxh/alien / update

Method update

source/Gui/TableLiveStatistics.cpp:35–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35void TableLiveStatistics::update(TimelineStatistics const& data)
36{
37 auto timepoint = std::chrono::steady_clock::now();
38
39 if (!_currentDataTimepoint.has_value()) {
40 _currentData = data;
41 _currentDataTimepoint = timepoint;
42 return;
43 }
44
45 auto duration = static_cast<int>(std::chrono::duration_cast<std::chrono::milliseconds>(timepoint - *_currentDataTimepoint).count());
46 if (duration > TimeInterval) {
47 _lastData = _currentData;
48 _lastDataTimepoint = _currentDataTimepoint;
49
50 _currentData = data;
51 _currentDataTimepoint = timepoint;
52 }
53}
54
55float TableLiveStatistics::calcObjectsPerSecond(ColorVector<uint64_t> const& lastCount, ColorVector<uint64_t> const& currentCount) const
56{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected