RTI Connext C# API Version 7.3.0
Omg.Dds.Core.Time Struct Reference

Represents a moment in time. More...

Inherits IEquatable< Time >, and IComparable< Time >.

Public Member Functions

 Time (long sec, uint nsec=0)
 Creates a new object with the specified absolute number of seconds and nanoseconds. More...
 
int CompareTo (Time other)
 Compares two times. More...
 
bool Equals (Time other)
 Compares two times 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 Time FromSeconds (ulong seconds)
 Creates a time from the specified total number of seconds. More...
 
static Time FromSeconds (double seconds)
 Creates a time from the specified total number of seconds. More...
 
static Time FromMilliseconds (ulong ms)
 Creates a time from the specified total number of milliseconds. More...
 
static bool operator== (in Time a, in Time b)
 Compares for equality. More...
 
static bool operator!= (in Time a, in Time b)
 Compares for inequality. More...
 
static bool operator< (in Time a, in Time b)
 Determines if one time value is smaller than another one. More...
 
static bool operator> (in Time a, in Time b)
 Determines if one time value is greater than another one. More...
 
static bool operator<= (in Time a, in Time b)
 Determines if one time value is smaller or equal than another one. More...
 
static bool operator>= (in Time a, in Time b)
 Determines if one time value is greater or equal than another one. More...
 
static Duration operator- (in Time a, in Time b)
 Calculate the duration between two times More...
 

Static Public Attributes

const uint NanosecondsPerSecond = 1_000_000_000
 Number of nanoseconds in a second More...
 
const uint NanosecondsPerMillisecond = 1_000_000
 Number of nanoseconds in a millisecond More...
 
const uint MillisecondsPerSecond = 1_000
 Number of milliseconds in a second More...
 

Properties

static Time Zero = new Time(0, 0) [get]
 The default instant in time: zero seconds and zero nanoseconds More...
 
static Time MaxValue [get]
 The maximum valid value of Time More...
 
static Time Invalid = new Time(-1, 0xffffffff) [get]
 A special sentinel that indicates an invalid or unknown time. More...
 
long 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...
 

Detailed Description

Represents a moment in time.

Constructor & Destructor Documentation

◆ Time()

Omg.Dds.Core.Time.Time ( long  sec,
uint  nsec = 0 
)

Creates a new object with the specified absolute number of seconds and nanoseconds.

Member Function Documentation

◆ FromSeconds() [1/2]

static Time Omg.Dds.Core.Time.FromSeconds ( ulong  seconds)
static

Creates a time from the specified total number of seconds.

◆ FromSeconds() [2/2]

static Time Omg.Dds.Core.Time.FromSeconds ( double  seconds)
static

Creates a time from the specified total number of seconds.

◆ FromMilliseconds()

static Time Omg.Dds.Core.Time.FromMilliseconds ( ulong  ms)
static

Creates a time from the specified total number of milliseconds.

◆ CompareTo()

int Omg.Dds.Core.Time.CompareTo ( Time  other)

Compares two times.

◆ Equals() [1/2]

bool Omg.Dds.Core.Time.Equals ( Time  other)

Compares two times for equality.

◆ Equals() [2/2]

override bool Omg.Dds.Core.Time.Equals ( object  obj)

Compares two objects for equality.

◆ GetHashCode()

override int Omg.Dds.Core.Time.GetHashCode ( )

Gets the hash code.

◆ ToString()

override string Omg.Dds.Core.Time.ToString ( )

Converts this object to a string.

◆ operator==()

static bool Omg.Dds.Core.Time.operator== ( in Time  a,
in Time  b 
)
static

Compares for equality.

◆ operator!=()

static bool Omg.Dds.Core.Time.operator!= ( in Time  a,
in Time  b 
)
static

Compares for inequality.

◆ operator<()

static bool Omg.Dds.Core.Time.operator< ( in Time  a,
in Time  b 
)
static

Determines if one time value is smaller than another one.

◆ operator>()

static bool Omg.Dds.Core.Time.operator> ( in Time  a,
in Time  b 
)
static

Determines if one time value is greater than another one.

◆ operator<=()

static bool Omg.Dds.Core.Time.operator<= ( in Time  a,
in Time  b 
)
static

Determines if one time value is smaller or equal than another one.

◆ operator>=()

static bool Omg.Dds.Core.Time.operator>= ( in Time  a,
in Time  b 
)
static

Determines if one time value is greater or equal than another one.

◆ operator-()

static Duration Omg.Dds.Core.Time.operator- ( in Time  a,
in Time  b 
)
inlinestatic

Calculate the duration between two times

Field Documentation

◆ NanosecondsPerSecond

const uint Omg.Dds.Core.Time.NanosecondsPerSecond = 1_000_000_000
static

Number of nanoseconds in a second

◆ NanosecondsPerMillisecond

const uint Omg.Dds.Core.Time.NanosecondsPerMillisecond = 1_000_000
static

Number of nanoseconds in a millisecond

◆ MillisecondsPerSecond

const uint Omg.Dds.Core.Time.MillisecondsPerSecond = 1_000
static

Number of milliseconds in a second

Property Documentation

◆ Zero

Time Omg.Dds.Core.Time.Zero = new Time(0, 0)
staticget

The default instant in time: zero seconds and zero nanoseconds

The full documentation is available in the C API: DDSTime_tTIME_ZERO

◆ MaxValue

Time Omg.Dds.Core.Time.MaxValue
staticget
Initial value:
= new Time(
0x7fffffffffffffff,
0xffffffff)
Time(long sec, uint nsec=0)
Creates a new object with the specified absolute number of seconds and nanoseconds.

The maximum valid value of Time

◆ Invalid

Time Omg.Dds.Core.Time.Invalid = new Time(-1, 0xffffffff)
staticget

A special sentinel that indicates an invalid or unknown time.

◆ Seconds

long Omg.Dds.Core.Time.Seconds
get

Gets the second component of this object.

◆ Nanoseconds

uint Omg.Dds.Core.Time.Nanoseconds
get

Gets the nanosecond component of this object.

◆ TotalMilliseconds

ulong Omg.Dds.Core.Time.TotalMilliseconds
get

Gets the total number of milliseconds