userver
C++ Async Framework
Loading...
Searching...
No Matches
cached_time.hpp
1
#
pragma
once
2
3
#
include
<
chrono
>
4
#
include
<
tuple
>
5
6
USERVER_NAMESPACE_BEGIN
7
8
namespace
utils::impl {
9
10
using
SystemTimePoint = std::chrono::system_clock::time_point;
11
using
SteadyTimePoint = std::chrono::steady_clock::time_point;
12
13
// To serialize a steady_clock::time_point, we need to convert it to a
14
// system_clock::time_point using now(). Calling now() myriad times in a row may
15
// be costly, so as an optimization we cache now() globally.
16
void
UpdateGlobalTime();
17
18
// Note: the two time points are not synchronized. They may also come from
19
// different 'UpdateGlobalTime' calls.
20
std::tuple<SystemTimePoint, SteadyTimePoint> GetGlobalTime();
21
22
}
// namespace utils::impl
23
24
USERVER_NAMESPACE_END
userver
utils
impl
cached_time.hpp
Generated on Wed May 15 2024 22:23:25 for userver by
Doxygen
1.10.0