|
DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
|
Represents a time interval (duration of time or elapsed time) measured as a positive or negative number of ticks. More...
#include <TimeSpan.h>
Public Member Functions | |
| TimeSpan () | |
| Initializes a new instance of TimeSpan to zero duration. | |
| TimeSpan (int64_t ticks) | |
| Initializes a new instance of TimeSpan to the specified number of ticks. | |
| int64_t | GetTicks () const |
| Gets the number of ticks that represent the value of the current TimeSpan structure. | |
| double | GetTotalDays () const |
| Gets the value of the current TimeSpan expressed in whole and fractional days. | |
| double | GetTotalHours () const |
| Gets the value of the current TimeSpan expressed in whole and fractional hours. | |
| double | GetTotalMilliseconds () const |
| Gets the value of the current TimeSpan expressed in whole and fractional milliseconds. | |
| double | GetTotalMinutes () const |
| Gets the value of the current TimeSpan expressed in whole and fractional minutes. | |
| double | GetTotalSeconds () const |
| Gets the value of the current TimeSpan expressed in whole and fractional seconds. | |
| bool | operator!= (const TimeSpan &other) const |
| Indicates whether two TimeSpan instances are not equal. | |
| TimeSpan | operator+ (const TimeSpan &other) const |
| Adds a specified TimeSpan to this instance. | |
| TimeSpan | operator- (const TimeSpan &other) const |
| Subtracts a specified TimeSpan from this instance. | |
| bool | operator< (const TimeSpan &other) const |
| Indicates whether a specified TimeSpan is less than another specified TimeSpan. | |
| bool | operator<= (const TimeSpan &other) const |
| Indicates whether a specified TimeSpan is less than or equal to another specified TimeSpan. | |
| bool | operator== (const TimeSpan &other) const |
| Indicates whether two TimeSpan instances are equal. | |
| bool | operator> (const TimeSpan &other) const |
| Indicates whether a specified TimeSpan is greater than another specified TimeSpan. | |
| bool | operator>= (const TimeSpan &other) const |
| Indicates whether a specified TimeSpan is greater than or equal to another specified TimeSpan. | |
| Public Member Functions inherited from DotNetDupe::System::Object | |
| virtual | ~Object ()=default |
| Virtual destructor ensuring polymorphic cleanup. | |
| virtual bool | Equals (const Object &obj) const |
| Determines whether the specified Object is equal to the current Object. | |
| virtual int | GetHashCode () const |
| Serves as the default hash function. | |
| bool | operator== (const Object &obj) const |
| Determines reference equality between two objects. | |
| char * | ToStringA () const |
| Returns narrow-character string representation. | |
| wchar_t * | ToStringW () const |
| Returns wide-character string representation. | |
Static Public Member Functions | |
| static TimeSpan | FromDays (double value) |
| Returns a TimeSpan that represents a specified number of days. | |
| static TimeSpan | FromHours (double value) |
| Returns a TimeSpan that represents a specified number of hours. | |
| static TimeSpan | FromMilliseconds (double value) |
| Returns a TimeSpan that represents a specified number of milliseconds. | |
| static TimeSpan | FromMinutes (double value) |
| Returns a TimeSpan that represents a specified number of minutes. | |
| static TimeSpan | FromSeconds (double value) |
| Returns a TimeSpan that represents a specified number of seconds. | |
| static TimeSpan | FromTicks (int64_t ticks) |
| Returns a TimeSpan that represents a specified number of ticks. | |
| Static Public Member Functions inherited from DotNetDupe::System::Object | |
| static bool | Equals (const Object &obj1, const Object &obj2) |
| Static helper determining whether two object instances are equal. | |
Static Public Attributes | |
| static constexpr int64_t | TicksPerDay = TicksPerHour * 24 |
| The number of ticks in 1 day. | |
| static constexpr int64_t | TicksPerHour = TicksPerMinute * 60 |
| The number of ticks in 1 hour. | |
| static constexpr int64_t | TicksPerMillisecond = 10000 |
| The number of ticks in 1 millisecond. | |
| static constexpr int64_t | TicksPerMinute = TicksPerSecond * 60 |
| The number of ticks in 1 minute. | |
| static constexpr int64_t | TicksPerSecond = TicksPerMillisecond * 1000 |
| The number of ticks in 1 second. | |
Represents a time interval (duration of time or elapsed time) measured as a positive or negative number of ticks.
Definition at line 20 of file TimeSpan.h.
|
inline |
Initializes a new instance of TimeSpan to zero duration.
Definition at line 38 of file TimeSpan.h.
Referenced by FromDays(), FromHours(), FromMilliseconds(), FromMinutes(), FromSeconds(), FromTicks(), DotNetDupe::System::TimeProvider::GetElapsedTime(), DotNetDupe::System::DateTime::GetTimeOfDay(), operator!=(), operator+(), DotNetDupe::System::DateTime::operator-(), DotNetDupe::System::DateTimeOffset::operator-(), operator-(), operator<(), operator<=(), operator==(), operator>(), and operator>=().
|
inline |
Initializes a new instance of TimeSpan to the specified number of ticks.
| ticks | A time period expressed in 100-nanosecond units. |
Definition at line 42 of file TimeSpan.h.
|
inlinestatic |
Returns a TimeSpan that represents a specified number of days.
| value | A number of days, accurate to the nearest millisecond. |
Definition at line 96 of file TimeSpan.h.
References TimeSpan(), and TicksPerDay.
|
inlinestatic |
Returns a TimeSpan that represents a specified number of hours.
| value | A number of hours, accurate to the nearest millisecond. |
Definition at line 91 of file TimeSpan.h.
References TimeSpan(), and TicksPerHour.
|
inlinestatic |
Returns a TimeSpan that represents a specified number of milliseconds.
| value | A number of milliseconds, accurate to the nearest millisecond. |
Definition at line 76 of file TimeSpan.h.
References TimeSpan(), and TicksPerMillisecond.
|
inlinestatic |
Returns a TimeSpan that represents a specified number of minutes.
| value | A number of minutes, accurate to the nearest millisecond. |
Definition at line 86 of file TimeSpan.h.
References TimeSpan(), and TicksPerMinute.
|
inlinestatic |
Returns a TimeSpan that represents a specified number of seconds.
| value | A number of seconds, accurate to the nearest millisecond. |
Definition at line 81 of file TimeSpan.h.
References TimeSpan(), and TicksPerSecond.
|
inlinestatic |
Returns a TimeSpan that represents a specified number of ticks.
| ticks | A number of 100-nanosecond ticks. |
Definition at line 71 of file TimeSpan.h.
References TimeSpan().
|
inline |
Gets the number of ticks that represent the value of the current TimeSpan structure.
Definition at line 46 of file TimeSpan.h.
Referenced by DotNetDupe::System::DateTime::Add(), DotNetDupe::System::Diagnostics::Stopwatch::ElapsedTicks(), DotNetDupe::System::TimeZone::IsDaylightSavingTime(), DotNetDupe::System::DateTime::operator+(), and DotNetDupe::System::DateTime::operator-().
|
inline |
Gets the value of the current TimeSpan expressed in whole and fractional days.
Definition at line 66 of file TimeSpan.h.
References TicksPerDay.
|
inline |
Gets the value of the current TimeSpan expressed in whole and fractional hours.
Definition at line 62 of file TimeSpan.h.
References TicksPerHour.
|
inline |
Gets the value of the current TimeSpan expressed in whole and fractional milliseconds.
Definition at line 50 of file TimeSpan.h.
References TicksPerMillisecond.
Referenced by DotNetDupe::System::Diagnostics::Stopwatch::ElapsedMilliseconds().
|
inline |
Gets the value of the current TimeSpan expressed in whole and fractional minutes.
Definition at line 58 of file TimeSpan.h.
References TicksPerMinute.
|
inline |
Gets the value of the current TimeSpan expressed in whole and fractional seconds.
Definition at line 54 of file TimeSpan.h.
References TicksPerSecond.
|
inline |
Indicates whether two TimeSpan instances are not equal.
Definition at line 102 of file TimeSpan.h.
References TimeSpan().
Adds a specified TimeSpan to this instance.
Definition at line 117 of file TimeSpan.h.
References TimeSpan().
Subtracts a specified TimeSpan from this instance.
Definition at line 120 of file TimeSpan.h.
References TimeSpan().
|
inline |
Indicates whether a specified TimeSpan is less than another specified TimeSpan.
Definition at line 105 of file TimeSpan.h.
References TimeSpan().
|
inline |
Indicates whether a specified TimeSpan is less than or equal to another specified TimeSpan.
Definition at line 108 of file TimeSpan.h.
References TimeSpan().
|
inline |
Indicates whether two TimeSpan instances are equal.
Definition at line 99 of file TimeSpan.h.
References TimeSpan().
|
inline |
Indicates whether a specified TimeSpan is greater than another specified TimeSpan.
Definition at line 111 of file TimeSpan.h.
References TimeSpan().
|
inline |
Indicates whether a specified TimeSpan is greater than or equal to another specified TimeSpan.
Definition at line 114 of file TimeSpan.h.
References TimeSpan().
|
staticconstexpr |
The number of ticks in 1 day.
Definition at line 35 of file TimeSpan.h.
Referenced by FromDays(), and GetTotalDays().
|
staticconstexpr |
The number of ticks in 1 hour.
Definition at line 32 of file TimeSpan.h.
Referenced by FromHours(), and GetTotalHours().
|
staticconstexpr |
The number of ticks in 1 millisecond.
Definition at line 23 of file TimeSpan.h.
Referenced by FromMilliseconds(), and GetTotalMilliseconds().
|
staticconstexpr |
The number of ticks in 1 minute.
Definition at line 29 of file TimeSpan.h.
Referenced by FromMinutes(), and GetTotalMinutes().
|
staticconstexpr |
The number of ticks in 1 second.
Definition at line 26 of file TimeSpan.h.
Referenced by FromSeconds(), DotNetDupe::System::TimeProvider::GetElapsedTime(), and GetTotalSeconds().