DPsim
Classes | Public Types | Public Member Functions | Protected Types | Protected Attributes | List of all members
DPsim::Timer Class Reference

Classes

struct  OverrunException
 

Public Types

enum  Flags : int { fail_on_overrun = 1 }
 
using Ticks = std::chrono::nanoseconds
 
using StartClock = std::chrono::system_clock
 
using IntervalClock = std::chrono::steady_clock
 
using StartTimePoint = std::chrono::time_point< StartClock, Ticks >
 
using IntervalTimePoint = std::chrono::time_point< IntervalClock, Ticks >
 

Public Member Functions

 Timer (int flags=0)
 
void start (const StartTimePoint &startAt)
 
void start ()
 Start real-time timer.
 
void stop ()
 Stop real-time timer.
 
void sleep ()
 Suspend thread execution until next tick.
 
const long long & overruns ()
 
long long ticks ()
 
Ticks interval ()
 
void setStartTime (const StartTimePoint &start)
 
void setInterval (const Ticks &intv)
 
void setInterval (double dt)
 

Protected Types

enum  State { running , stopped }
 

Protected Attributes

enum DPsim::Timer::State mState
 
StartTimePoint mStartAt
 
IntervalTimePoint mNextTick
 
Ticks mTickInterval
 
long long mOverruns
 
long long mTicks
 
int mFlags
 

Detailed Description

Definition at line 17 of file Timer.h.


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