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...
 
Timeoperator+= (const Time &rhs)
 In-place addition operator. More...
 
Timeoperator-= (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
secondsThe number of seconds.

◆ Time() [3/4]

Murl::System::Time::Time ( UInt64  seconds)

Constructor taking integer seconds.

Parameters
secondsThe number of seconds.

◆ Time() [4/4]

Murl::System::Time::Time ( UInt64  seconds,
UInt64  nanoSeconds 
)

Constructor taking seconds and nanoseconds.

Parameters
secondsThe number of seconds.
nanoSecondsThe number of nanoseconds.

Member Function Documentation

◆ GetNow()

static Time Murl::System::Time::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 Time Murl::System::Time::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 void Murl::System::Time::SetNowMonotonic ( Bool  monotonic)
static

Sets the behaviour of Murl::System::GetNow.

Default is false.

Parameters
monotonictrue to force GetNow returning monotonic values

◆ GetTickCount()

static Time Murl::System::Time::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()

static Time Murl::System::Time::FromSeconds ( UInt64  seconds)
static

Get the time from specified seconds.

Parameters
secondsThe number of seconds.
Returns
The Time object containing the number of seconds.

◆ FromMilliSeconds()

static Time Murl::System::Time::FromMilliSeconds ( UInt64  milliSeconds)
static

Get the time from specified milliseconds.

Parameters
milliSecondsThe number of milliseconds.
Returns
The Time object containing the number of milliseconds.

◆ FromMicroSeconds()

static Time Murl::System::Time::FromMicroSeconds ( UInt64  microSeconds)
static

Get the time from specified microseconds.

Parameters
microSecondsThe number of microseconds.
Returns
The Time object containing the number of microseconds.

◆ FromNanoSeconds()

static Time Murl::System::Time::FromNanoSeconds ( UInt64  nanoSeconds)
static

Get the time from specified nanoseconds.

Parameters
nanoSecondsThe number of nanoseconds.
Returns
The Time object containing the number of nanoseconds.

◆ Zero()

static Time Murl::System::Time::Zero ( )
static

Get zero time.

Returns
The Time object containing zero time.

◆ Infinite()

static Time Murl::System::Time::Infinite ( )
static

Get infinite time.

Returns
The Time object containing infinite time.

◆ Min()

static Time Murl::System::Time::Min ( )
static

Get minimum time.

Returns
The Time object containing zero time.

◆ Max()

static Time Murl::System::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
secondsThe 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
secondsThe 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
milliSecondsThe 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
microSecondsThe 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
nanoSecondsThe 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+=()

Time& Murl::System::Time::operator+= ( const Time rhs)

In-place addition operator.

Parameters
rhsThe time to add.
Returns
The object itself.

◆ operator-=()

Time& Murl::System::Time::operator-= ( const Time rhs)

In-place subtraction operator.

Parameters
rhsThe time to subtract.
Returns
The object itself.

◆ operator+()

Time Murl::System::Time::operator+ ( const Time rhs) const

Addition operator.

Parameters
rhsThe right hand side time.
Returns
The added time.

◆ operator-()

Time Murl::System::Time::operator- ( const Time rhs) const

Subtraction operator.

Parameters
rhsThe right hand side time.
Returns
The subtracted time.

◆ operator==()

bool Murl::System::Time::operator== ( const Time rhs) const

Equal to comparison operator.

Parameters
rhsThe 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
rhsThe 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
rhsThe 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
rhsThe 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
rhsThe 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
rhsThe 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


Copyright © 2011-2024 Spraylight GmbH.