Open Lighting Architecture  Latest Git
Public Member Functions | List of all members
ola::Clock Class Reference

Detailed Description

Used to get the current time.

Inheritance diagram for ola::Clock:
Inheritance graph
[legend]

Public Member Functions

virtual void CurrentMonotonicTime (TimeStamp *timestamp) const
 Sets timestamp to the current monotonic time. More...
 
virtual void CurrentRealTime (TimeStamp *timestamp) const
 Sets timestamp to the current real time. More...
 
virtual void CurrentTime (TimeStamp *timestamp) const
 Wrapper around CurrentRealime. More...
 

Member Function Documentation

◆ CurrentMonotonicTime()

void ola::Clock::CurrentMonotonicTime ( TimeStamp timestamp) const
virtual

Sets timestamp to the current monotonic time.

The timestamp parameter will be set to the current monotonic time only if the system has a monotonic clock available. If a monotonic clock is unavailable, this method will fallback to CurrentRealTime.

The system's monotonic clock is not subject to discontinuous jumps due to administrative action, but may be affected by incremental adjustment due to time synchronization protocol e.g. NTP. The monotonic clock does not advance while the system is suspended. An appropriate use of this method is to measure elapsed time.

See also
Clock::CurrentRealTime
Parameters
[out]timestampA TimeStamp pointer

Reimplemented in ola::MockClock.

◆ CurrentRealTime()

void ola::Clock::CurrentRealTime ( TimeStamp timestamp) const
virtual

Sets timestamp to the current real time.

The timestamp parameter will be set to the current real i.e. wall-clock time.

The system's realtime clock is subject to discontinuous and incremental adjustment due to administrative action or time synchronization protocol e.g. NTP. An appropriate use of this method is to display a user-facing timestamp.

See also
Clock::CurrentMonotonicTime
Parameters
[out]timestampA TimeStamp pointer

Reimplemented in ola::MockClock.

◆ CurrentTime()

void ola::Clock::CurrentTime ( TimeStamp timestamp) const
virtual

Wrapper around CurrentRealime.

Parameters
[out]timestampA TimeStamp pointer
Deprecated:
Please use either Clock::CurrentMonotonicTime or Clock::CurrentRealTime as appropriate (25 Oct 2020).

Reimplemented in ola::MockClock.


The documentation for this class was generated from the following files: