| 130 | } |
| 131 | |
| 132 | std::optional<uint64_t> Variable::GetSecondsSinceLastUse() const |
| 133 | { |
| 134 | std::lock_guard<std::mutex> lock(_mutex); |
| 135 | if (_lastUsed.time_since_epoch().count() == 0) { |
| 136 | return {}; |
| 137 | } |
| 138 | |
| 139 | const auto now = std::chrono::high_resolution_clock::now(); |
| 140 | return std::chrono::duration_cast<std::chrono::seconds>(now - _lastUsed) |
| 141 | .count(); |
| 142 | } |
| 143 | |
| 144 | std::optional<uint64_t> Variable::GetSecondsSinceLastChange() const |
| 145 | { |
no test coverage detected