32 void set(
const timespec& t);
37 void set(
unsigned long nsec);
57 [[nodiscard]]
bool isEnabled()
const;
67 [[nodiscard]]
TimeSpec getElapseTime()
const;
92 explicit operator bool()
const;
104 bool _enabled{
false};
112 TimeSpec _elapsedTime{};
145inline ElapseTimer::operator bool()
const
Timer for turning true when a certain amount of time has passed.
Definition ElapseTimer.h:12
void set(unsigned long nsec)
Setting the elapse time and enabling the timer where param 't' is in nano seconds.
ElapseTimer(unsigned long usec)
Initializing constructor setting the elapse time in usec.
TimeSpec getTimeOver() const
Returns the time over after the timer elapsed.
void disable()
Disables timer so Active does not return non-zero any more.
Definition ElapseTimer.h:125
void set(const timespec &t)
Setting the elapse time and enabling the timer.
void reset()
Sets the timer up to elapse again.
Definition ElapseTimer.h:120
TimeSpec getElapseTime() const
Returns the elapse time set or initialized by the constructor.
Definition ElapseTimer.h:140
TimeSpec getTimeOver(const timespec &) const
Returns the time over after the timer elapsed.
ElapseTimer()
Default constructor.
TimeSpec getTimeLeft(const timespec &) const
Returns the time left before the timer elapses.
TimeSpec getTimeLeft() const
Returns the time left before the timer elapses.
bool operator()(const timespec &t) const
This operator is used to minimize clock() calls. Return non-zero if timer is active.
bool isActive() const
Returns true if the time has elapsed and enabled.
void enable()
Enables timer so without resetting the elapse time.
Definition ElapseTimer.h:130
bool isEnabled() const
Returns non-zero is the timer is enabled.
Definition ElapseTimer.h:135
#define _MISC_CLASS
Definition misc/global.h:40
Definition Application.h:10
Class wrapper for timespec structure to modify.
Definition TimeSpec.h:12