#include "Stroika/Foundation/StroikaPreComp.h"
#include <chrono>
#include "Stroika/Foundation/Common/TypeHints.h"
#include "Stroika/Foundation/Time/Clock.h"
#include "Stroika/Foundation/Traversal/Common.h"
#include "Realtime.inl"
Go to the source code of this file.
Namespaces | |
namespace | Stroika::Foundation |
namespace | Stroika::Foundation::Traversal::RangeTraits |
Typedefs | |
using | Stroika::Foundation::Time::DurationSeconds = chrono::duration< double > |
chrono::duration<double> - a time span (length of time) measured in seconds, but high precision. | |
using | Stroika::Foundation::Time::RealtimeClock = chrono::steady_clock |
this is an alias for steady_clock; this is the clock used for GetTickCount () results. | |
using | Stroika::Foundation::Time::TimePointSeconds = time_point< RealtimeClock, DurationSeconds > |
TimePointSeconds is a simpler approach to chrono::time_point, which doesn't require using templates everywhere. | |
using | Stroika::Foundation::Time::DisplayedRealtimeClock = AppStartZeroedClock< RealtimeClock, DurationSeconds > |
Functions | |
TimePointSeconds | Stroika::Foundation::Time::GetTickCount () noexcept |
get the current (monotonically increasing) time - from RealtimeClock | |
Variables | |
constexpr DurationSeconds | Stroika::Foundation::Time::kInfinity = DurationSeconds{numeric_limits<DurationSeconds::rep>::infinity ()} |
Definition in file Realtime.h.
using Stroika::Foundation::Time::DurationSeconds = typedef chrono::duration<double> |
chrono::duration<double> - a time span (length of time) measured in seconds, but high precision.
DurationSeconds is just a choice of what chrono::duration template parameters to use to make use much simpler. Converting to a common sensible base format greatly simplifies a number of Stroika APIs, so rather than having to template all your 'duration' arguments, just use this DurationSeconds for simplicity, clarity, and at only a small cost.
Definition at line 57 of file Realtime.h.
using Stroika::Foundation::Time::RealtimeClock = typedef chrono::steady_clock |
this is an alias for steady_clock; this is the clock used for GetTickCount () results.
The clock it uses IS guaranteed to be a 'steady' clock, though not necessarily THE 'steady_clock' class.
Definition at line 70 of file Realtime.h.
using Stroika::Foundation::Time::TimePointSeconds = typedef time_point<RealtimeClock, DurationSeconds> |
TimePointSeconds is a simpler approach to chrono::time_point, which doesn't require using templates everywhere.
But - TimePointSeconds - since it uses chrono::time_point - is mostly (see Pin2SafeSeconds()) interoperable with the other time_point etc objects.
Definition at line 82 of file Realtime.h.
using Stroika::Foundation::Time::DisplayedRealtimeClock = typedef AppStartZeroedClock<RealtimeClock, DurationSeconds> |
If you want to convert tick-count times to be zero based (often helpful for display purposes), you can use:
Definition at line 112 of file Realtime.h.
|
noexcept |
get the current (monotonically increasing) time - from RealtimeClock
Since Stroika v3.0d5 - defined to be based on RealtimeClock (which is same - steady_clock), and uses double internally (using DurationSeconds = chrono::duration<double>). And to get it to be zero based,
Definition at line 16 of file Realtime.inl.
|
constexpr |
@See http://stroika-bugs.sophists.com/browse/STK-619 CONSIDER LOSING THIS - AND USE special TYPE and overloading, and handle kInfinity differently - no arithmatic, just no timeout
Definition at line 104 of file Realtime.h.