Skip to content

Class ILLIXR::RelativeClock

ClassList > ILLIXR > RelativeClock

Relative clock for all of ILLIXR .More...

  • #include <relative_clock.hpp>

Inherits the following classes: ILLIXR::phonebook::service

Public Types

Type Name
typedef _clock_duration duration
typedef _clock_period period
typedef _clock_rep rep
typedef time_point time_point

Public Static Attributes

Type Name
constexpr bool is_steady = true

Public Functions

Type Name
int64_t absolute_ns (time_point relative)
time_point now () const
void start ()
Starts the clock. All times are relative to this point.

Public Functions inherited from ILLIXR::phonebook::service

See ILLIXR::phonebook::service

Type Name
virtual ~service ()

Detailed Description

Please use this instead of std::chrono clocks; this way, you can fake real time without changing your code.

It also eliminates the class of bugs relating to using absolute time instead of time-since-start.

Unfortunately this can't satisfy Clock because it needs to have data (namely _m_start) shared across link-time boundaries. There's no clean way to do this with static variables, so instead I use instance variables and Phonebook.

Public Types Documentation

typedef duration

using ILLIXR::RelativeClock::duration =  _clock_duration;

typedef period

using ILLIXR::RelativeClock::period =  _clock_period;

typedef rep

using ILLIXR::RelativeClock::rep =  _clock_rep;

typedef time_point

using ILLIXR::RelativeClock::time_point =  time_point;

Public Static Attributes Documentation

variable is_steady

constexpr bool ILLIXR::RelativeClock::is_steady;

Public Functions Documentation

function absolute_ns

inline int64_t ILLIXR::RelativeClock::absolute_ns (
    time_point relative
) 

function now

inline time_point ILLIXR::RelativeClock::now () const

function start

Starts the clock. All times are relative to this point.

inline void ILLIXR::RelativeClock::start () 



The documentation for this class was generated from the following file common/relative_clock.hpp