CatapultServer
v0.5.0.1 (Elephant)
|
Represents a time duration. More...
Public Member Functions | |
constexpr | TimeSpan () |
Creates a default (zero) time span. More... | |
constexpr uint64_t | hours () const |
Returns the number of hours. More... | |
constexpr uint64_t | minutes () const |
Returns the number of minutes. More... | |
constexpr uint64_t | seconds () const |
Returns the number of seconds. More... | |
constexpr uint64_t | millis () const |
Returns the number of milliseconds. More... | |
constexpr bool | operator== (const TimeSpan &rhs) const |
Returns true if this time span is equal to rhs. More... | |
constexpr bool | operator!= (const TimeSpan &rhs) const |
Returns true if this time span is not equal to rhs. More... | |
constexpr bool | operator>= (const TimeSpan &rhs) const |
Returns true if this time span is greater than or equal to rhs. More... | |
constexpr bool | operator> (const TimeSpan &rhs) const |
Returns true if this time span is greater than rhs. More... | |
constexpr bool | operator<= (const TimeSpan &rhs) const |
Returns true if this time span is less than or equal to rhs. More... | |
constexpr bool | operator< (const TimeSpan &rhs) const |
Returns true if this time span is less than rhs. More... | |
Static Public Member Functions | |
static constexpr TimeSpan | FromHours (uint64_t hours) |
Creates a time span from the given number of hours. More... | |
static constexpr TimeSpan | FromMinutes (uint64_t minutes) |
Creates a time span from the given number of minutes. More... | |
static constexpr TimeSpan | FromSeconds (uint64_t seconds) |
Creates a time span from the given number of seconds. More... | |
static constexpr TimeSpan | FromMilliseconds (uint64_t milliseconds) |
Creates a time span from the given number of milliseconds. More... | |
static constexpr TimeSpan | FromDifference (Timestamp end, Timestamp start) |
Creates a time span from the difference between start and end. More... | |
Private Member Functions | |
template<typename TRep , typename TPeriod > | |
constexpr | TimeSpan (const std::chrono::duration< TRep, TPeriod > &duration) |
Static Private Member Functions | |
template<typename TDuration > | |
static constexpr uint64_t | ConvertToDuration (const std::chrono::milliseconds &millis) |
Private Attributes | |
std::chrono::milliseconds | m_millis |
Represents a time duration.
|
inlineexplicitconstexprprivate |
|
inlineconstexpr |
Creates a default (zero) time span.
|
inlinestaticconstexprprivate |
|
inlinestaticconstexpr |
Creates a time span from the difference between start and end.
|
inlinestaticconstexpr |
Creates a time span from the given number of hours.
|
inlinestaticconstexpr |
Creates a time span from the given number of milliseconds.
|
inlinestaticconstexpr |
Creates a time span from the given number of minutes.
|
inlinestaticconstexpr |
Creates a time span from the given number of seconds.
|
inlineconstexpr |
Returns the number of hours.
|
inlineconstexpr |
Returns the number of milliseconds.
|
inlineconstexpr |
Returns the number of minutes.
|
inlineconstexpr |
Returns true
if this time span is not equal to rhs.
|
inlineconstexpr |
Returns true
if this time span is less than rhs.
|
inlineconstexpr |
Returns true
if this time span is less than or equal to rhs.
|
inlineconstexpr |
Returns true
if this time span is equal to rhs.
|
inlineconstexpr |
Returns true
if this time span is greater than rhs.
|
inlineconstexpr |
Returns true
if this time span is greater than or equal to rhs.
|
inlineconstexpr |
Returns the number of seconds.
|
private |