This util class helps with keeping a cycle time during a control cycle.
More...
#include <ArmarXCore/core/time/CycleUtil.h>
|
| static IceUtil::Time | now () |
| |
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.
- Note
- If system time is used (i.e. not the timeserver) the monotonic clock is used.
◆ CycleUtil() [1/2]
| CycleUtil |
( |
const IceUtil::Time & | cycleDuration, |
|
|
bool | forceSystemTime = false ) |
◆ CycleUtil() [2/2]
| CycleUtil |
( |
const std::int64_t & | cycleDurationMs, |
|
|
bool | forceSystemTime = false ) |
◆ getAverageDuration()
| IceUtil::Time getAverageDuration |
( |
| ) |
const |
◆ getBusyWaitShare()
| float getBusyWaitShare |
( |
| ) |
const |
◆ getCycleCount()
| std::int64_t getCycleCount |
( |
| ) |
const |
◆ getLastCycleTime()
| IceUtil::Time getLastCycleTime |
( |
| ) |
const |
Time when the last cycle finished or start time.
◆ getMaximumDuration()
| IceUtil::Time getMaximumDuration |
( |
| ) |
const |
◆ getMinimumDuration()
| IceUtil::Time getMinimumDuration |
( |
| ) |
const |
◆ getStartTime()
| IceUtil::Time getStartTime |
( |
| ) |
const |
Time when object was constructed or reset was last called.
◆ now()
◆ reset()
resets startTime, lastCycleTime and cycleCount.
◆ setBusyWaitShare()
| void setBusyWaitShare |
( |
float | value | ) |
|
◆ update()
◆ waitForCycleDuration()
| 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.
- Returns
- returns the time the function waited
◆ busyWaitShare
◆ cycleCount
◆ cycleDuration
| IceUtil::Time cycleDuration |
|
protected |
◆ cycleMaxDuration
| IceUtil::Time cycleMaxDuration |
|
protected |
◆ cycleMinDuration
| IceUtil::Time cycleMinDuration |
|
protected |
◆ forceSystemTime
◆ lastCycleTime
| IceUtil::Time lastCycleTime |
|
protected |
◆ startTime
The documentation for this class was generated from the following files: