class
#include <BipedalLocomotion/System/IClock.h>
IClock IClock is the interface to the clock.
The Clock is considered as a singleton. Please use the ClockBuilder to create a clock. The default clock is the System::BipedalLocomotion::clock().now();
Derived classes
Constructors, destructors, conversion operators
Public functions
- auto now() -> std::chrono::nanoseconds pure virtual
- Get the current time.
- void sleepFor(const std::chrono::nanoseconds& sleepDuration) pure virtual
- Blocks the execution of the current thread for at least the specified sleepDuration.
- void sleepUntil(const std::chrono::nanoseconds& time) pure virtual
- Blocks the execution of the current thread until specified sleepTime has been reached.
- void yield() pure virtual
- Provides a hint to the implementation to reschedule the execution of threads, allowing other threads to run.
Function documentation
BipedalLocomotion:: System:: IClock:: IClock() protected defaulted
The constructor is protected.
Please create the clock with ClockBulder.
std::chrono::nanoseconds BipedalLocomotion:: System:: IClock:: now() pure virtual
Get the current time.
Returns | The current time. The output of the function depends on the concrete implementation. |
---|
void BipedalLocomotion:: System:: IClock:: sleepUntil(const std::chrono::nanoseconds& time) pure virtual
Blocks the execution of the current thread until specified sleepTime has been reached.
Parameters | |
---|---|
time | to block until |