Death::Containers::TimeSpan class

Time interval.

Public static functions

static auto FromMilliseconds(std::int64_t milliseconds) -> TimeSpan constexpr noexcept
Returns TimeSpan that represents a specified number of milliseconds.
static auto FromSeconds(std::int64_t seconds) -> TimeSpan constexpr noexcept
Returns TimeSpan that represents a specified number of seconds.
static auto FromMinutes(std::int32_t minutes) -> TimeSpan constexpr noexcept
Returns TimeSpan that represents a specified number of minutes.
static auto FromHours(std::int32_t hours) -> TimeSpan constexpr noexcept
Returns TimeSpan that represents a specified number of hours.
static auto FromDays(std::int32_t days) -> TimeSpan constexpr noexcept
Returns TimeSpan that represents a specified number of days.
static auto FromWeeks(std::int32_t days) -> TimeSpan constexpr noexcept
Returns TimeSpan that represents a specified number of weeks.

Constructors, destructors, conversion operators

TimeSpan() constexpr noexcept
Creates empty TimeSpan structure.
TimeSpan(NoInitT) explicit noexcept
Creates uninitialized TimeSpan structure.
TimeSpan(std::int64_t milliseconds) constexpr noexcept
Creates TimeSpan structure from milliseconds.
TimeSpan(std::int32_t hours, std::int32_t minutes, std::int64_t seconds = 0, std::int64_t milliseconds = 0) constexpr noexcept
Creates TimeSpan structure from individual parts.

Public functions

auto GetTotalWeeks() const -> std::int32_t constexpr noexcept
Returns the value of this instance expressed in whole weeks.
auto GetTotalDays() const -> std::int32_t constexpr noexcept
Returns the value of this instance expressed in whole days.
auto GetTotalHours() const -> std::int64_t constexpr noexcept
Returns the value of this instance expressed in whole hours.
auto GetTotalMinutes() const -> std::int64_t constexpr noexcept
Returns the value of this instance expressed in whole minutes.
auto GetTotalSeconds() const -> std::int64_t constexpr noexcept
Returns the value of this instance expressed in whole seconds.
auto GetTotalMilliseconds() const -> std::int64_t constexpr noexcept
Returns the value of this instance expressed in whole milliseconds.
auto GetValue() const -> std::int64_t constexpr noexcept
auto operator+=(const TimeSpan& ts) -> TimeSpan& constexpr noexcept
auto operator+(const TimeSpan& ts) const -> TimeSpan constexpr noexcept
auto operator-=(const TimeSpan& ts) -> TimeSpan& constexpr noexcept
auto operator-(const TimeSpan& ts) const -> TimeSpan constexpr noexcept
auto operator*=(std::int32_t n) -> TimeSpan& constexpr noexcept
auto operator*(std::int32_t n) const -> TimeSpan constexpr noexcept
auto operator-() -> TimeSpan& constexpr noexcept
auto operator!() const -> bool constexpr noexcept
auto operator<(const TimeSpan& ts) const -> bool constexpr noexcept
auto operator<=(const TimeSpan& ts) const -> bool constexpr noexcept
auto operator>(const TimeSpan& ts) const -> bool constexpr noexcept
auto operator>=(const TimeSpan& ts) const -> bool constexpr noexcept
auto operator==(const TimeSpan& ts) const -> bool constexpr noexcept
auto operator!=(const TimeSpan& ts) const -> bool constexpr noexcept

Function documentation

Death::Containers::TimeSpan::TimeSpan(std::int32_t hours, std::int32_t minutes, std::int64_t seconds = 0, std::int64_t milliseconds = 0) constexpr noexcept

Creates TimeSpan structure from individual parts.

Parameters
hours Hours
minutes Minutes after the hour (0-59)
seconds Seconds after the minute (0-59*)
milliseconds Milliseconds after the second (0-999)