The time class provides high resolution time data. More...
#include "murl_system_time.h"
Public Member Functions | |
Time () | |
The default constructor. More... | |
Time (Double seconds) | |
Constructor taking floating point seconds. More... | |
Time (UInt64 seconds) | |
Constructor taking integer seconds. More... | |
Time (UInt64 seconds, UInt64 nanoSeconds) | |
Constructor taking seconds and nanoseconds. More... | |
void | SetNow () |
Set to the current time-of-day. More... | |
void | SetTickCount () |
Set to the current tick count. More... | |
void | SetZero () |
Set to the zero time. | |
void | SetInfinite () |
Set to the infinite time. | |
Double | GetDouble () const |
Get the time in floating point seconds. More... | |
void | SetDouble (Double seconds) |
Set the time from floating point seconds. More... | |
UInt64 | GetSeconds () const |
Get the time in integer seconds. More... | |
void | SetSeconds (UInt64 seconds) |
Set the time in integer seconds. More... | |
UInt64 | GetMilliSeconds () const |
Get the time in milliseconds. More... | |
void | SetMilliSeconds (UInt64 milliSeconds) |
Set the time in milliseconds. More... | |
UInt64 | GetMicroSeconds () const |
Get the time in microseconds. More... | |
void | SetMicroSeconds (UInt64 microSeconds) |
Set the time in microseconds. More... | |
UInt64 | GetNanoSeconds () const |
Get the time in nanoseconds. More... | |
void | SetNanoSeconds (UInt64 nanoSeconds) |
Set the time in nanoseconds. More... | |
UInt64 | GetMilliSecondsFraction () const |
Get the seconds fractional part in milliseconds. More... | |
UInt64 | GetMicroSecondsFraction () const |
Get the seconds fractional part in microseconds. More... | |
UInt64 | GetNanoSecondsFraction () const |
Get the seconds fractional part in nanoseconds. More... | |
Bool | IsZero () const |
Check if the time is zero. More... | |
Bool | IsInfinite () const |
Check if the time is infinite. More... | |
Time & | operator+= (const Time &rhs) |
In-place addition operator. More... | |
Time & | operator-= (const Time &rhs) |
In-place subtraction operator. More... | |
Time | operator+ (const Time &rhs) const |
Addition operator. More... | |
Time | operator- (const Time &rhs) const |
Subtraction operator. More... | |
bool | operator== (const Time &rhs) const |
Equal to comparison operator. More... | |
bool | operator!= (const Time &rhs) const |
Not equal to comparison operator. More... | |
bool | operator< (const Time &rhs) const |
Less than operator. More... | |
bool | operator<= (const Time &rhs) const |
Less than or equal to operator. More... | |
bool | operator> (const Time &rhs) const |
Greater than operator. More... | |
bool | operator>= (const Time &rhs) const |
Greater than or equal to operator. More... | |
String | ToString () const |
Get the string representation of the object. More... | |
Static Public Member Functions | |
static Time | GetNow () |
Get the current time-of-day. More... | |
static Time | GetNowMonotonic () |
Get the current time-of-day. More... | |
static void | SetNowMonotonic (Bool monotonic) |
Sets the behaviour of Murl::System::GetNow. More... | |
static Time | GetTickCount () |
Get the current tick count. More... | |
static Time | FromSeconds (UInt64 seconds) |
Get the time from specified seconds. More... | |
static Time | FromMilliSeconds (UInt64 milliSeconds) |
Get the time from specified milliseconds. More... | |
static Time | FromMicroSeconds (UInt64 microSeconds) |
Get the time from specified microseconds. More... | |
static Time | FromNanoSeconds (UInt64 nanoSeconds) |
Get the time from specified nanoseconds. More... | |
static Time | Zero () |
Get zero time. More... | |
static Time | Infinite () |
Get infinite time. More... | |
static Time | Min () |
Get minimum time. More... | |
static Time | Max () |
Get maximum time. More... | |
Protected Attributes | |
UInt64 | mSeconds |
The seconds. | |
UInt64 | mNanoSeconds |
The nanoseconds fraction. | |
Detailed Description
The time class provides high resolution time data.
Constructor & Destructor Documentation
◆ Time() [1/4]
Murl::System::Time::Time | ( | ) |
The default constructor.
The time is set to zero.
◆ Time() [2/4]
Murl::System::Time::Time | ( | Double | seconds | ) |
Constructor taking floating point seconds.
- Parameters
-
seconds The number of seconds.
◆ Time() [3/4]
Murl::System::Time::Time | ( | UInt64 | seconds | ) |
Constructor taking integer seconds.
- Parameters
-
seconds The number of seconds.
◆ Time() [4/4]
Constructor taking seconds and nanoseconds.
- Parameters
-
seconds The number of seconds. nanoSeconds The number of nanoseconds.
Member Function Documentation
◆ GetNow()
|
static |
Get the current time-of-day.
The time is the number of seconds since 00:00 hours, Jan 1, 1970 UTC.
- Returns
- The Time object containing the time from now.
◆ GetNowMonotonic()
|
static |
Get the current time-of-day.
The time is the number of seconds since 00:00 hours, Jan 1, 1970 UTC. Guaranteed monotonic behaviour.
- Returns
- The Time object containing the time from now.
◆ SetNowMonotonic()
|
static |
Sets the behaviour of Murl::System::GetNow.
Default is false.
- Parameters
-
monotonic true to force GetNow returning monotonic values
◆ GetTickCount()
|
static |
Get the current tick count.
The tick count is the absolute elapsed time since some arbitrary, fixed point in the past.
It is not affected by changes in the system time-of-day clock.
- Returns
- The Time object containing the current tick count.
◆ FromSeconds()
Get the time from specified seconds.
- Parameters
-
seconds The number of seconds.
- Returns
- The Time object containing the number of seconds.
◆ FromMilliSeconds()
Get the time from specified milliseconds.
- Parameters
-
milliSeconds The number of milliseconds.
- Returns
- The Time object containing the number of milliseconds.
◆ FromMicroSeconds()
Get the time from specified microseconds.
- Parameters
-
microSeconds The number of microseconds.
- Returns
- The Time object containing the number of microseconds.
◆ FromNanoSeconds()
Get the time from specified nanoseconds.
- Parameters
-
nanoSeconds The number of nanoseconds.
- Returns
- The Time object containing the number of nanoseconds.
◆ Zero()
|
static |
Get zero time.
- Returns
- The Time object containing zero time.
◆ Infinite()
|
static |
Get infinite time.
- Returns
- The Time object containing infinite time.
◆ Min()
|
static |
Get minimum time.
- Returns
- The Time object containing zero time.
◆ Max()
|
static |
Get maximum time.
- Returns
- The Time object containing infinite time.
◆ SetNow()
void Murl::System::Time::SetNow | ( | ) |
Set to the current time-of-day.
The time is the number of seconds since 00:00 hours, Jan 1, 1970 UTC.
◆ SetTickCount()
void Murl::System::Time::SetTickCount | ( | ) |
Set to the current tick count.
The tick count is the absolute elapsed time since some arbitrary, fixed point in the past.
It is not affected by changes in the system time-of-day clock.
◆ GetDouble()
Double Murl::System::Time::GetDouble | ( | ) | const |
Get the time in floating point seconds.
- Returns
- The time in number of seconds.
◆ SetDouble()
void Murl::System::Time::SetDouble | ( | Double | seconds | ) |
Set the time from floating point seconds.
- Parameters
-
seconds The time in number of seconds.
◆ GetSeconds()
UInt64 Murl::System::Time::GetSeconds | ( | ) | const |
Get the time in integer seconds.
- Returns
- The time in seconds.
◆ SetSeconds()
void Murl::System::Time::SetSeconds | ( | UInt64 | seconds | ) |
Set the time in integer seconds.
- Parameters
-
seconds The time in seconds.
◆ GetMilliSeconds()
UInt64 Murl::System::Time::GetMilliSeconds | ( | ) | const |
Get the time in milliseconds.
- Returns
- The time in milliseconds.
◆ SetMilliSeconds()
void Murl::System::Time::SetMilliSeconds | ( | UInt64 | milliSeconds | ) |
Set the time in milliseconds.
- Parameters
-
milliSeconds The time in milliseconds.
◆ GetMicroSeconds()
UInt64 Murl::System::Time::GetMicroSeconds | ( | ) | const |
Get the time in microseconds.
- Returns
- The time in microseconds.
◆ SetMicroSeconds()
void Murl::System::Time::SetMicroSeconds | ( | UInt64 | microSeconds | ) |
Set the time in microseconds.
- Parameters
-
microSeconds The time in microseconds.
◆ GetNanoSeconds()
UInt64 Murl::System::Time::GetNanoSeconds | ( | ) | const |
Get the time in nanoseconds.
- Returns
- The time in nanoseconds.
◆ SetNanoSeconds()
void Murl::System::Time::SetNanoSeconds | ( | UInt64 | nanoSeconds | ) |
Set the time in nanoseconds.
- Parameters
-
nanoSeconds The time in nanoseconds.
◆ GetMilliSecondsFraction()
UInt64 Murl::System::Time::GetMilliSecondsFraction | ( | ) | const |
Get the seconds fractional part in milliseconds.
- Returns
- The seconds fractional part in milliseconds.
◆ GetMicroSecondsFraction()
UInt64 Murl::System::Time::GetMicroSecondsFraction | ( | ) | const |
Get the seconds fractional part in microseconds.
- Returns
- The seconds fractional part in microseconds.
◆ GetNanoSecondsFraction()
UInt64 Murl::System::Time::GetNanoSecondsFraction | ( | ) | const |
Get the seconds fractional part in nanoseconds.
- Returns
- The seconds fractional part in nanoseconds.
◆ IsZero()
Bool Murl::System::Time::IsZero | ( | ) | const |
Check if the time is zero.
- Returns
- true if the time is zero.
◆ IsInfinite()
Bool Murl::System::Time::IsInfinite | ( | ) | const |
Check if the time is infinite.
- Returns
- true if the time is infinite.
◆ operator+=()
In-place addition operator.
- Parameters
-
rhs The time to add.
- Returns
- The object itself.
◆ operator-=()
In-place subtraction operator.
- Parameters
-
rhs The time to subtract.
- Returns
- The object itself.
◆ operator+()
Addition operator.
- Parameters
-
rhs The right hand side time.
- Returns
- The added time.
◆ operator-()
Subtraction operator.
- Parameters
-
rhs The right hand side time.
- Returns
- The subtracted time.
◆ operator==()
bool Murl::System::Time::operator== | ( | const Time & | rhs | ) | const |
Equal to comparison operator.
- Parameters
-
rhs The right hand side time to compare.
- Returns
- true if the time is the same.
◆ operator!=()
bool Murl::System::Time::operator!= | ( | const Time & | rhs | ) | const |
Not equal to comparison operator.
- Parameters
-
rhs The right hand side time to compare.
- Returns
- true if the time is not the same.
◆ operator<()
bool Murl::System::Time::operator< | ( | const Time & | rhs | ) | const |
Less than operator.
- Parameters
-
rhs The right hand side time to compare.
- Returns
- true if the left hand side (this) is less than the right hand side.
◆ operator<=()
bool Murl::System::Time::operator<= | ( | const Time & | rhs | ) | const |
Less than or equal to operator.
- Parameters
-
rhs The right hand side time to compare.
- Returns
- true if the left hand side (this) is less than or equal to the right hand side.
◆ operator>()
bool Murl::System::Time::operator> | ( | const Time & | rhs | ) | const |
Greater than operator.
- Parameters
-
rhs The right hand side time to compare.
- Returns
- true if the left hand side (this) is greater than the right hand side.
◆ operator>=()
bool Murl::System::Time::operator>= | ( | const Time & | rhs | ) | const |
Greater than or equal to operator.
- Parameters
-
rhs The right hand side time to compare.
- Returns
- true if the left hand side (this) is greater than or equal to the right hand side.
◆ ToString()
String Murl::System::Time::ToString | ( | ) | const |
Get the string representation of the object.
- Returns
- The string representation of the object.
The documentation for this class was generated from the following file:
- murl_system_time.h