11 using ms = std::chrono::milliseconds;
12 using namespace std::chrono_literals;
15 std::chrono::time_point<std::chrono::high_resolution_clock>
_timestamp;
34 inline explicit operator bool()
const;
44 timer::timer() : _timestamp{std::chrono::high_resolution_clock::now()} {}
57 reduce_timeout::operator bool()
const {
58 return _timer.elapsed() < _timeout;
63 return std::chrono::duration_cast<ms>(
elapsed);
timer _timer
Definition time.hpp:25
ms _timeout
Definition time.hpp:24
ms elapsed() const
Definition time.hpp:53
ms remaining() const
Definition time.hpp:46
reduce_timeout(ms timeout)
Definition time.hpp:41
std::chrono::time_point< std::chrono::high_resolution_clock > _timestamp
Definition time.hpp:15
ms elapsed() const
Definition time.hpp:61
timer()
Definition time.hpp:44
std::chrono::milliseconds ms
Definition time.hpp:11