RTI Connext C# API
7.0.0
|
Represents a time duration. More...
Inherits IEquatable< Duration >, and IComparable< Duration >.
Public Member Functions | |
Duration (int sec, uint nsec=0) | |
Creates a new object with the specified absolute number of seconds and nanoseconds. More... | |
int | CompareTo (Duration other) |
Compares two durations. More... | |
bool | Equals (Duration other) |
Compares two durations for equality. More... | |
override bool | Equals (object obj) |
Compares two objects for equality. More... | |
override int | GetHashCode () |
Gets the hash code. More... | |
override string | ToString () |
Converts this object to a string. More... | |
Static Public Member Functions | |
static Duration | FromSeconds (uint seconds) |
Creates a duration from the specified total number of seconds. More... | |
static Duration | FromSeconds (double seconds) |
Creates a duration from the specified total number of seconds. More... | |
static Duration | FromMilliseconds (ulong ms) |
Creates a duration from the specified total number of milliseconds. More... | |
static bool | operator== (in Duration a, in Duration b) |
Compares for equality. More... | |
static bool | operator!= (in Duration a, in Duration b) |
Compares for inequality. More... | |
static bool | operator< (in Duration a, in Duration b) |
Determines if one duration is smaller than another duration. More... | |
static bool | operator> (in Duration a, in Duration b) |
Determines if one duration is greater than another duration. More... | |
static bool | operator<= (in Duration a, in Duration b) |
Determines if one duration is smaller or equal than another duration. More... | |
static bool | operator>= (in Duration a, in Duration b) |
Determines if one duration is larger or equal than another duration. More... | |
static Duration | operator- (in Duration a, in Duration b) |
Substracts two durations. More... | |
static Duration | operator+ (in Duration a, in Duration b) |
Adds two durations. More... | |
static | operator TimeSpan (Duration d) |
Explicit conversion from Duration to TimeSpan. Loss of precision is possible, since a TimeSpan has a smaller resolution. More... | |
static | operator Duration (TimeSpan t) |
Explicit conversion from TimeSpan to Duration. More... | |
Static Public Attributes | |
const uint | NanosecondsPerSecond |
Constant defining how many nanoseconds are in a second More... | |
const uint | NanosecondsPerMillisecond |
Constant defining how many nanoseconds are in a millisecond More... | |
const uint | MillisecondsPerSecond |
Constant defining how many milliseconds are in a second More... | |
Properties | |
static Duration | Zero [get] |
Object representing a zero duration. More... | |
static Duration | Infinite [get] |
Object representing an Infinite duration More... | |
static Duration | Auto [get] |
Object indicating that the duration should be automatically determined. More... | |
int | Seconds [get] |
Gets the second component of this object. More... | |
uint | Nanoseconds [get] |
Gets the nanosecond component of this object. More... | |
ulong | TotalMilliseconds [get] |
Gets the total number of milliseconds More... | |
Represents a time duration.
Duration | ( | int | sec, |
uint | nsec = 0 |
||
) |
Creates a new object with the specified absolute number of seconds and nanoseconds.
int CompareTo | ( | Duration | other | ) |
Compares two durations.
bool Equals | ( | Duration | other | ) |
Compares two durations for equality.
override bool Equals | ( | object | obj | ) |
Compares two objects for equality.
|
static |
Creates a duration from the specified total number of milliseconds.
|
static |
Creates a duration from the specified total number of seconds.
|
static |
Creates a duration from the specified total number of seconds.
override int GetHashCode | ( | ) |
Gets the hash code.
|
explicitstatic |
Explicit conversion from TimeSpan to Duration.
|
explicitstatic |
Explicit conversion from Duration to TimeSpan. Loss of precision is possible, since a TimeSpan has a smaller resolution.
Determines if one duration is smaller than another duration.
Determines if one duration is smaller or equal than another duration.
Determines if one duration is greater than another duration.
Determines if one duration is larger or equal than another duration.
override string ToString | ( | ) |
Converts this object to a string.
|
static |
Constant defining how many milliseconds are in a second
|
static |
Constant defining how many nanoseconds are in a millisecond
|
static |
Constant defining how many nanoseconds are in a second
|
staticget |
Object indicating that the duration should be automatically determined.
|
staticget |
Object representing an Infinite duration
|
get |
Gets the nanosecond component of this object.
|
get |
Gets the second component of this object.
|
get |
Gets the total number of milliseconds
|
staticget |
Object representing a zero duration.