userver: userver/utils/datetime/wall_coarse_clock.hpp Source File
⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
wall_coarse_clock.hpp
Go to the documentation of this file.
1#pragma once
2
3/// @file userver/utils/datetime/wall_coarse_clock.hpp
4/// @brief @copybrief utils::datetime::WallCoarseClock
5
6#include <chrono>
7
8USERVER_NAMESPACE_BEGIN
9
10namespace utils::datetime {
11
12/// @ingroup userver_universal
13///
14/// @brief System clock with up to a few millisecond resolution that is slightly
15/// faster than the std::chrono::system_clock
16struct WallCoarseClock final {
17 // Duration matches system clock, but it is updated once in a few milliseconds
18 using duration = std::chrono::system_clock::duration;
19 using rep = duration::rep;
20 using period = duration::period;
21 using time_point = std::chrono::system_clock::time_point;
22
23 static constexpr bool is_steady = false;
24
25 static time_point now() noexcept;
26 static duration resolution() noexcept;
27};
28
29} // namespace utils::datetime
30
31USERVER_NAMESPACE_END