Project Chrono: chrono::ChRealtimeStepTimer Class Reference

Public Member Functions | List of all members
chrono::ChRealtimeStepTimer Class Reference

## Description

Class for a timer which attempts to enforce soft real-time.

`#include <ChRealtimeStep.h>`

Inheritance diagram for chrono::ChRealtimeStepTimer:
[legend]
Collaboration diagram for chrono::ChRealtimeStepTimer:
[legend]

## Public Member Functions
| ChRealtimeStepTimer ()
| Create the timer (outside the simulation loop, preferably just before beginning the loop).
void | Spin (double step)
| Call this function INSIDE the simulation loop, just ONCE per loop (preferably as the last call in the loop), passing it the integration step size used at this step.
Public Member Functions inherited from chrono::ChTimer
void | start ()
| Start the timer.
void | stop ()
| Stop the timer.
void | reset ()
| Reset the total accumulated time (when repeating multiple start/stop).
unsigned long long | GetTimeMilliseconds () const
| Return the time in milliseconds.
unsigned long long | GetTimeMicroseconds () const
| Return the time in microseconds.
double | GetTimeSeconds () const
| Return the time in seconds.
double | operator() () const
| Get the last timer value, in seconds.

## Member Function Documentation

## ◆ Spin()

void chrono::ChRealtimeStepTimer::Spin | ( | double | step | ) |
| inline

Call this function INSIDE the simulation loop, just ONCE per loop (preferably as the last call in the loop), passing it the integration step size used at this step.

If the time elapsed over the last step (i.e., from the last call to Spin) is small than the integration step size, this function will spin in place until real time catches up with the simulation time, thus providing soft real-time capabilities.

The documentation for this class was generated from the following file:

- D:/W/B/src/chrono-9.0.1/src/chrono/core/ChRealtimeStep.h