MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / GetSecondsSinceLastUse

Method GetSecondsSinceLastUse

lib/variables/variable.cpp:132–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132std::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
144std::optional<uint64_t> Variable::GetSecondsSinceLastChange() const
145{

Callers 2

formatLastUsedTextFunction · 0.80
test-variable.cppFile · 0.80

Calls 2

nowClass · 0.85
countMethod · 0.80

Tested by

no test coverage detected