RTI Connext C# API Version 7.2.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 = 1_000_000_000 |
Constant defining how many nanoseconds are in a second More... | |
const uint | NanosecondsPerMillisecond = 1_000_000 |
Constant defining how many nanoseconds are in a millisecond More... | |
const uint | MillisecondsPerSecond = 1_000 |
Constant defining how many milliseconds are in a second More... | |
Properties | |
static Duration | Zero = new Duration(0, 0) [get] |
Object representing a zero duration. More... | |
static Duration | Infinite [get] |
Object representing an Infinite duration More... | |
static Duration | Auto = new Duration(-1, 0) [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.
Omg.Dds.Core.Duration.Duration | ( | int | sec, |
uint | nsec = 0 |
||
) |
Creates a new object with the specified absolute number of seconds and nanoseconds.
|
static |
Creates a duration from the specified total number of seconds.
|
static |
Creates a duration from the specified total number of seconds.
|
static |
Creates a duration from the specified total number of milliseconds.
int Omg.Dds.Core.Duration.CompareTo | ( | Duration | other | ) |
Compares two durations.
bool Omg.Dds.Core.Duration.Equals | ( | Duration | other | ) |
Compares two durations for equality.
override bool Omg.Dds.Core.Duration.Equals | ( | object | obj | ) |
Compares two objects for equality.
override int Omg.Dds.Core.Duration.GetHashCode | ( | ) |
Gets the hash code.
override string Omg.Dds.Core.Duration.ToString | ( | ) |
Converts this object to a string.
Compares for equality.
Compares for inequality.
Determines if one duration is smaller than another duration.
Determines if one duration is greater than another duration.
Determines if one duration is smaller or equal than another duration.
Determines if one duration is larger or equal than another duration.
Substracts two durations.
Adds two durations.
|
explicitstatic |
Explicit conversion from Duration to TimeSpan. Loss of precision is possible, since a TimeSpan has a smaller resolution.
|
explicitstatic |
Explicit conversion from TimeSpan to Duration.
|
static |
Constant defining how many nanoseconds are in a second
|
static |
Constant defining how many nanoseconds are in a millisecond
|
static |
Constant defining how many milliseconds are in a second
Object representing a zero duration.
|
staticget |
Object representing an Infinite duration
Object indicating that the duration should be automatically determined.
|
get |
Gets the second component of this object.
|
get |
Gets the nanosecond component of this object.
|
get |
Gets the total number of milliseconds