Toolbox snapshot
The Reactive C++ Toolbox
|
#include <toolbox/sys/Time.hpp>
Public Member Functions | |
MonoTime | mono_time () const noexcept |
WallTime | wall_time () const noexcept |
void | set_wall_time (WallTime wall_time) noexcept |
Static Public Member Functions | |
static CyclTime | current () noexcept |
static CyclTime | now () noexcept |
static CyclTime | now (WallTime wall_time) noexcept |
This overload allows users to override wall-clock time. | |
The "cycle-time" represents the start of a processing cycle. This could be, for example, when a thread wakes from a call to epoll_wait().
Application cycles often require both wall-clock and monotonic time. (Monotonic is primarily used for interval timers.) Rather than pass wall-clock and monotonic time as a parameter down through the function call-tree, these times are cached in a thread-local object.
The CyclTime tag type (empty class) is designed to make the thread-local programming contract more explicit, without consuming extra registers required for parameter passing - assuming that the optimiser will optimise-away empty tag parameters.
Definition at line 129 of file Time.hpp.
Referenced by toolbox::sys::SigWait::operator()(), and toolbox::sys::SigWait::operator()().
|
inlinenoexcept |
Definition at line 140 of file Time.hpp.
Referenced by toolbox::io::TimerQueue::dispatch(), and toolbox::io::Reactor::poll().
|
inlinenoexcept |