| 12 | } |
| 13 | |
| 14 | ProcessIoCounter::IOCounterDiff ProcessIoCounter::Update() |
| 15 | { |
| 16 | if (!GetProcessIoCounters(m_handle, m_counterCur)) |
| 17 | return {}; |
| 18 | |
| 19 | IOCounterDiff const diff |
| 20 | { |
| 21 | m_counterCur->ReadTransferCount - m_counterPrev->ReadTransferCount, |
| 22 | m_counterCur->WriteTransferCount - m_counterPrev->WriteTransferCount, |
| 23 | std::chrono::steady_clock::now() - m_lastUpdate |
| 24 | }; |
| 25 | std::swap(m_counterPrev, m_counterCur); |
| 26 | m_lastUpdate = std::chrono::steady_clock::now(); |
| 27 | return diff; |
| 28 | } |
| 29 | |
| 30 | ProcessIoCounter::IOCounter ProcessIoCounter::GetTotal() |
| 31 | { |