Class ILLIXR::relative_clock
ClassList > ILLIXR > relative_clock
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 |
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::relative_clock::duration = clock_duration_;
Public Functions Documentation
function absolute_ns
inline int64_t ILLIXR::relative_clock::absolute_ns (
time_point relative
)
function is_started
Check if the clock is started.
inline bool ILLIXR::relative_clock::is_started () const
function now
inline time_point ILLIXR::relative_clock::now () const
function start
Starts the clock. All times are relative to this point.
inline void ILLIXR::relative_clock::start ()
function start_time
Get the start time of the clock.
inline time_point ILLIXR::relative_clock::start_time () const
The documentation for this class was generated from the following file /home/friedel/devel/ILLIXR/include/illixr/relative_clock.hpp