diff --git a/chrono/datetime.h b/chrono/datetime.h index 857c76d..43cf7a4 100644 --- a/chrono/datetime.h +++ b/chrono/datetime.h @@ -64,6 +64,7 @@ public: static DateTime fromTimeStamp(time_t timeStamp); static DateTime fromTimeStampGmt(time_t timeStamp); + uint64 &ticks(); constexpr uint64 totalTicks() const; int year() const; int month() const; @@ -212,6 +213,14 @@ inline DateTime DateTime::fromIsoStringLocal(const char *str) return fromIsoString(str).first; } +/*! + * \brief Returns a mutable reference to the total ticks. + */ +inline uint64 &DateTime::ticks() +{ + return m_ticks; +} + /*! * \brief Returns the number of ticks which represent the value of the current instance. */ diff --git a/chrono/timespan.h b/chrono/timespan.h index 04a2fc4..9ac0720 100644 --- a/chrono/timespan.h +++ b/chrono/timespan.h @@ -42,6 +42,7 @@ public: static constexpr TimeSpan negativeInfinity(); static constexpr TimeSpan infinity(); + int64 &ticks(); constexpr int64 totalTicks() const; constexpr double totalMicroseconds() const; constexpr double totalMilliseconds() const; @@ -181,6 +182,14 @@ constexpr inline TimeSpan TimeSpan::infinity() return TimeSpan(std::numeric_limits::max()); } +/*! + * \brief Returns a mutable reference to the total ticks. + */ +inline int64 &TimeSpan::ticks() +{ + return m_ticks; +} + /*! * \brief Returns the number of ticks that represent the value of the current TimeSpan class. */