1 #ifndef SENS_SIMCLOCK_H
2 #define SENS_SIMCLOCK_H
59 const std::lock_guard<std::mutex> lock(
_pauseMutex);
76 const std::lock_guard<std::mutex> lock(
_pauseMutex);
std::chrono::microseconds SENSMicroseconds
std::chrono::high_resolution_clock::time_point SENSTimePt
SENSTimePt now() const
get current simulation time (const function which should be thread save)
SENSTimePt _simStartTimePt
start time point of simulation in the past
void pause()
pause simulation
SENSTimePt _startTimePt
real start time point in the present (when SENSSimulation::start was called)
void resume()
resume simulation
SENSMicroseconds _pauseTime
Offset from pause state: we have to accumulate pause times and subtract it from sim time.
SENSMicroseconds passedTime() const
get passed simulation time
std::atomic_bool _pause
atomic, because we use it in now without mutex
SENSSimClock(SENSTimePt startTimePt, SENSTimePt simStartTimePt)