raisim::TimedLoop
class · #include <raisim/helper.hpp>
Scope guard for fixed-rate loops: its destructor sleeps until loopTimeInUs after its construction. Create one at the top of the loop body (see RS_TIMED_LOOP).
Constructors & destructor
TimedLoop
cpp
explicit TimedLoop(uint64_t loop_time_in_us)Parameters
| Parameter | Description |
|---|---|
loop_time_in_us (in) | loop period (microseconds) |
~TimedLoop
cpp
~TimedLoop()Sleeps until begin + loopTimeInUs (returns immediately if that time has passed).
Public attributes
begin
cpp
std::chrono::steady_clock::time_point beginConstruction time.
loopTimeInUs
cpp
uint64_t loopTimeInUsLoop period (microseconds).