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 diff) constexpr noexcept
Creates TimeSpan structure from milliseconds.
TimeSpan(std::int32_t hours, std::int32_t minutes, std::int64_t seconds = 0, std::int64_t millisecs = 0) constexpr noexcept
Creates TimeSpan structure from individual parts.

Public functions

auto GetWeeks() const -> std::int32_t constexpr noexcept
auto GetDays() const -> std::int32_t constexpr noexcept
auto GetHours() const -> std::int32_t constexpr noexcept
auto GetMinutes() const -> std::int32_t constexpr noexcept
auto GetSeconds() const -> std::int64_t constexpr noexcept
auto GetMilliseconds() const -> std::int64_t constexpr noexcept
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 millisecs = 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*)
millisecs Milliseconds after the second (0-999)