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 |
Public Static Attributes
Type | Name |
---|---|
constexpr bool | is_steady = true |
Public Functions
Type | Name |
---|---|
int64_t | absolute_ns (time_point relative) |
bool | is_started () const Check if the clock is started. |
time_point | now () const |
void | start () Starts the clock. All times are relative to this point. |
time_point | start_time () const Get the start time of the clock. |
Public Functions inherited from ILLIXR::phonebook::service
See ILLIXR::phonebook::service
Type | Name |
---|---|
virtual | ~service () = default |
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;
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 is_started
Check if the clock is started.
inline bool ILLIXR::RelativeClock::is_started () const
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 ()
function start_time
Get the start time of the clock.
inline time_point ILLIXR::RelativeClock::start_time () const
The documentation for this class was generated from the following file include/illixr/relative_clock.hpp