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);
124 template <
typename T>
128 struct Default<Time::DurationSeconds> {
133 static constexpr inline Openness kLowerBoundOpenness{Openness::eClosed};
134 static constexpr inline Openness kUpperBoundOpenness{Openness::eClosed};
136 static constexpr inline value_type kLowerBound{Time::DurationSeconds::min ()};
137 static constexpr inline value_type kUpperBound{Time::DurationSeconds::max ()};
139 static value_type GetNext (value_type i);
140 static value_type GetPrevious (value_type i);
146 struct Default<Time::TimePointSeconds> {
151 static constexpr inline Openness kLowerBoundOpenness{Openness::eClosed};
152 static constexpr inline Openness kUpperBoundOpenness{Openness::eClosed};
154 static constexpr inline value_type kLowerBound{value_type{Time::DurationSeconds::min ()}};
155 static constexpr inline value_type kUpperBound{value_type{Time::DurationSeconds::max ()}};
157 static value_type GetNext (value_type i);
158 static value_type GetPrevious (value_type i);
160 static constexpr SignedDifferenceType Difference (Common::ArgByValueType<value_type> lhs, Common::ArgByValueType<value_type> rhs);
164 struct Default<chrono::time_point<Time::DisplayedRealtimeClock, Time::DurationSeconds>> {
165 using value_type = chrono::time_point<Time::DisplayedRealtimeClock, Time::DurationSeconds>;
166 using SignedDifferenceType = Time::DurationSeconds;
167 using UnsignedDifferenceType = Time::DurationSeconds;
169 static constexpr inline Openness kLowerBoundOpenness{Openness::eClosed};
170 static constexpr inline Openness kUpperBoundOpenness{Openness::eClosed};
172 static constexpr inline value_type kLowerBound{value_type{Time::DurationSeconds::min ()}};
173 static constexpr inline value_type kUpperBound{value_type{Time::DurationSeconds::max ()}};
175 static value_type GetNext (value_type i);
176 static value_type GetPrevious (value_type i);
178 static constexpr SignedDifferenceType Difference (Common::ArgByValueType<value_type> lhs, Common::ArgByValueType<value_type> rhs);
188#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.