6 #include "Mountain/core.hpp" 7 #include "Mountain/utils/time_span.hpp" 21 static int64_t GetFrequency();
23 static int64_t GetTimestamp();
25 static TimeSpan GetElapsedTime(int64_t startingTimestamp);
27 static TimeSpan GetElapsedTime(int64_t startingTimestamp, int64_t endingTimestamp);
34 GETTER(bool_t, IsRunning, m_IsRunning)
39 int64_t GetElapsedTicks()
const;
41 double_t GetElapsedMilliseconds()
const;
43 double_t GetElapsedSeconds()
const;
48 static constexpr int64_t TicksPerMillisecond = 10000;
49 static constexpr int64_t TicksPerSecond = TicksPerMillisecond * 1000;
51 static const double_t TickFrequency;
53 int64_t m_StartTimestamp = 0;
54 int64_t m_Elapsed = 0;
55 bool_t m_IsRunning =
false;
58 int64_t GetRawElapsedTicks()
const;
60 int64_t GetElapsedDateTimeTicks()
const;
69 template <
class ParseContext>
70 constexpr
typename ParseContext::iterator
parse(ParseContext& ctx)
72 auto it = ctx.begin();
77 throw std::format_error(
"Invalid format args for Mountain::Stopwatch");
84 template <
class FormatContext>
87 std::ostringstream out;
89 out << stopwatch.GetElapsed();
91 return std::ranges::copy(std::move(out).str(), ctx.out()).out;
C++ reimplementation of the .NET Stopwatch class.
C++ reimplementation of the .NET TimeSpan struct.
MATH_TOOLBOX std::ostream & operator<<(std::ostream &out, const Matrix &m)
Contains all declarations of the Mountain Framework.