Skip to content

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

ParameterDescription
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 begin

Construction time.

loopTimeInUs ​

cpp
uint64_t loopTimeInUs

Loop period (microseconds).

RaiSim — physics for robotics and AI.