|
This util class helps with keeping a cycle time during a control cycle. More...
#include <ArmarXCore/core/time/CycleUtil.h>
Public Member Functions | |
CycleUtil (const IceUtil::Time &cycleDuration, bool forceSystemTime=false) | |
CycleUtil (const std::int64_t &cycleDurationMs, bool forceSystemTime=false) | |
IceUtil::Time | getAverageDuration () const |
float | getBusyWaitShare () const |
std::int64_t | getCycleCount () const |
Count of how many cycles were executed, i.e. More... | |
IceUtil::Time | getLastCycleTime () const |
Time when the last cycle finished or start time. More... | |
IceUtil::Time | getMaximumDuration () const |
IceUtil::Time | getMinimumDuration () const |
IceUtil::Time | getStartTime () const |
Time when object was constructed or reset was last called. More... | |
void | reset () |
resets startTime, lastCycleTime and cycleCount. More... | |
void | setBusyWaitShare (float value) |
IceUtil::Time | update () |
IceUtil::Time | waitForCycleDuration () |
This function will wait (virtual or system time) until the cycle time is reached. More... | |
Static Protected Member Functions | |
static IceUtil::Time | now () |
Protected Attributes | |
float | busyWaitShare |
std::int64_t | cycleCount |
IceUtil::Time | cycleDuration |
IceUtil::Time | cycleMaxDuration |
IceUtil::Time | cycleMinDuration |
bool | forceSystemTime |
IceUtil::Time | lastCycleTime |
IceUtil::Time | startTime |
This util class helps with keeping a cycle time during a control cycle.
The main function is waitForCycleDuration(), which should be called in every cycle. The function will wait (virtual or system time) until the cycle time is reached. If the last cycle took already too long, it will return immediately. The last cycle time is updated, when waitForCycleDuration() is called.
Definition at line 40 of file CycleUtil.h.
CycleUtil | ( | const IceUtil::Time & | cycleDuration, |
bool | forceSystemTime = false |
||
) |
CycleUtil | ( | const std::int64_t & | cycleDurationMs, |
bool | forceSystemTime = false |
||
) |
IceUtil::Time getAverageDuration | ( | ) | const |
float getBusyWaitShare | ( | ) | const |
Definition at line 126 of file CycleUtil.cpp.
std::int64_t getCycleCount | ( | ) | const |
Count of how many cycles were executed, i.e.
how often waitForCycleDuration() was called.
Definition at line 97 of file CycleUtil.cpp.
IceUtil::Time getLastCycleTime | ( | ) | const |
Time when the last cycle finished or start time.
Definition at line 146 of file CycleUtil.cpp.
IceUtil::Time getMaximumDuration | ( | ) | const |
Definition at line 120 of file CycleUtil.cpp.
IceUtil::Time getMinimumDuration | ( | ) | const |
Definition at line 114 of file CycleUtil.cpp.
IceUtil::Time getStartTime | ( | ) | const |
Time when object was constructed or reset was last called.
Definition at line 91 of file CycleUtil.cpp.
|
staticprotected |
void reset | ( | ) |
resets startTime, lastCycleTime and cycleCount.
Definition at line 44 of file CycleUtil.cpp.
void setBusyWaitShare | ( | float | value | ) |
IceUtil::Time update | ( | ) |
Definition at line 73 of file CycleUtil.cpp.
IceUtil::Time waitForCycleDuration | ( | ) |
This function will wait (virtual or system time) until the cycle time is reached.
If the last cycle took already too long, it will return immediately. The last cycle time is updated, when this function is called.
Definition at line 53 of file CycleUtil.cpp.
|
protected |
Definition at line 88 of file CycleUtil.h.
|
protected |
Definition at line 86 of file CycleUtil.h.
|
protected |
Definition at line 83 of file CycleUtil.h.
|
protected |
Definition at line 85 of file CycleUtil.h.
|
protected |
Definition at line 84 of file CycleUtil.h.
|
protected |
Definition at line 87 of file CycleUtil.h.
|
protected |
Definition at line 82 of file CycleUtil.h.
|
protected |
Definition at line 81 of file CycleUtil.h.