4#ifndef _Stroika_Foundation_Time_Realtime_h_
5#define _Stroika_Foundation_Time_Realtime_h_ 1
7#include "Stroika/Foundation/StroikaPreComp.h"
24namespace Stroika::Foundation::Time {
26 using chrono::time_point;
58 static_assert (
sizeof (DurationSeconds::rep) ==
sizeof (
DurationSeconds));
59 static_assert (floating_point<DurationSeconds::rep>);
71 static_assert (RealtimeClock::is_steady);
126 template <
typename T>
130 struct Default<Time::DurationSeconds> {
135 static constexpr inline Openness kLowerBoundOpenness{Openness::eClosed};
136 static constexpr inline Openness kUpperBoundOpenness{Openness::eClosed};
138 static constexpr inline value_type kLowerBound{Time::DurationSeconds::min ()};
139 static constexpr inline value_type kUpperBound{Time::DurationSeconds::max ()};
141 static value_type GetNext (value_type i);
142 static value_type GetPrevious (value_type i);
148 struct Default<Time::TimePointSeconds> {
153 static constexpr inline Openness kLowerBoundOpenness{Openness::eClosed};
154 static constexpr inline Openness kUpperBoundOpenness{Openness::eClosed};
156 static constexpr inline value_type kLowerBound{value_type{Time::DurationSeconds::min ()}};
157 static constexpr inline value_type kUpperBound{value_type{Time::DurationSeconds::max ()}};
159 static value_type GetNext (value_type i);
160 static value_type GetPrevious (value_type i);
162 static constexpr SignedDifferenceType Difference (Common::ArgByValueType<value_type> lhs, Common::ArgByValueType<value_type> rhs);
166 struct Default<chrono::time_point<Time::DisplayedRealtimeClock, Time::DurationSeconds>> {
167 using value_type = chrono::time_point<Time::DisplayedRealtimeClock, Time::DurationSeconds>;
168 using SignedDifferenceType = Time::DurationSeconds;
169 using UnsignedDifferenceType = Time::DurationSeconds;
171 static constexpr inline Openness kLowerBoundOpenness{Openness::eClosed};
172 static constexpr inline Openness kUpperBoundOpenness{Openness::eClosed};
174 static constexpr inline value_type kLowerBound{value_type{Time::DurationSeconds::min ()}};
175 static constexpr inline value_type kUpperBound{value_type{Time::DurationSeconds::max ()}};
177 static value_type GetNext (value_type i);
178 static value_type GetPrevious (value_type i);
180 static constexpr SignedDifferenceType Difference (Common::ArgByValueType<value_type> lhs, Common::ArgByValueType<value_type> rhs);
190#include "Realtime.inl"
time_point< RealtimeClock, DurationSeconds > TimePointSeconds
TimePointSeconds is a simpler approach to chrono::time_point, which doesn't require using templates e...
chrono::steady_clock RealtimeClock
this is an alias for steady_clock; this is the clock used for GetTickCount () results.
chrono::duration< double > DurationSeconds
chrono::duration<double> - a time span (length of time) measured in seconds, but high precision.
TimePointSeconds GetTickCount() noexcept
get the current (monotonically increasing) time - from RealtimeClock
conditional_t<(sizeof(CHECK_T)<=2 *sizeof(void *)) and is_trivially_copyable_v< CHECK_T >, CHECK_T, const CHECK_T & > ArgByValueType
This is an alias for 'T' - but how we want to pass it on stack as formal parameter.