4#ifndef _Stroika_Foundation_Time_Clock_h_
5#define _Stroika_Foundation_Time_Clock_h_ 1
7#include "Stroika/Foundation/StroikaPreComp.h"
11#include "Stroika/Foundation/Common/Common.h"
19namespace Stroika::Foundation::Time {
54 template <
typename DESTINATION_CLOCK_T,
typename SOURCE_CLOCK_T,
typename DURATION_T>
55 typename DESTINATION_CLOCK_T::time_point
clock_cast (chrono::time_point<SOURCE_CLOCK_T, DURATION_T> tp);
56 template <
typename DESTINATION_CLOCK_T,
template <
typename>
typename RANGE,
typename SOURCE_CLOCK_T,
typename DURATION_T>
57 RANGE<typename DESTINATION_CLOCK_T::time_point>
clock_cast (RANGE<chrono::time_point<SOURCE_CLOCK_T, DURATION_T>> tpRange);
64 template <
typename BASE_CLOCK_T,
typename DURATION_T =
typename BASE_CLOCK_T::duration>
67 using Implementation_ = BASE_CLOCK_T;
70 using duration = DURATION_T;
71 using rep =
typename duration::rep;
72 using period =
typename duration::period;
73 using time_point = chrono::time_point<AppStartZeroedClock<BASE_CLOCK_T, DURATION_T>>;
74 static constexpr bool is_steady = Implementation_::is_steady;
77 [[nodiscard]]
static time_point now ()
noexcept;
80 static const inline duration kTimeAppStartedOffset_ = chrono::duration_cast<duration> (BASE_CLOCK_T::now ().time_since_epoch ());
DESTINATION_CLOCK_T::time_point clock_cast(chrono::time_point< SOURCE_CLOCK_T, DURATION_T > tp)
like std::chrono::clock_cast, but supports steady_clock, and others not explicitly supported by std::...