69 long milliseconds = 0,
116 PInt64 milliseconds = 0,
145 operator bool()
const;
196 long milliseconds = 0,
245 PInt64 milliseconds = 0,
416 enum { Stopped, Running, Paused } m_state;
423 PInt64 m_absoluteTime;
427 #include "msos/ptlib/timer.h"
429 #include "unix/ptlib/timer.h"
433 #endif // PTLIB_TIMER_H
PAtomicInteger::IntegerType GetNextSerialNumber()
Definition: timer.h:384
PTimer & operator=(DWORD milliseconds)
Restart the timer in one shot mode using the specified time value.
bool HasExpired() const
Indicate timer has expired.
This class defines an arbitrary time interval to millisecond accuracy.
Definition: timeint.h:55
Class specialisation for PNotifierTemplate
virtual void SetInterval(PInt64 milliseconds=0, long seconds=0, long minutes=0, long hours=0, int days=0)
Set the value of the time interval.
virtual ~PTimer()
Destroy the timer object, removing it from the applications timer list if it was running.
void Pause()
Pause a running timer.
virtual void OnTimeout()
This function is called on time out.
virtual void SetInterval(PInt64 milliseconds=0, long seconds=0, long minutes=0, long hours=0, int days=0)
Set the value of the time interval.
void Stop()
Stop the timer.
void Stop(bool wait=true)
Stop a running timer.
bool IsRunning() const
Indicate timer has not expired.
PBoolean IsRunning() const
Determine if the timer is currently running.
PTimeInterval m_startTick
Definition: timer.h:149
A class representing a system timer.
Definition: timer.h:181
BOOL PBoolean
Definition: object.h:102
PTimeInterval GetElapsed() const
Return the real time elapsed since instantiation.
Definition: pprocess.h:106
void RunContinuous(const PTimeInterval &time)
Start a timer in continous cycle mode.
This class implements an integer that can be atomically incremented and decremented in a thread-safe ...
Definition: critsec.h:171
PSimpleTimer & operator=(DWORD milliseconds)
Restart the timer using the specified time value.
PTimer(long milliseconds=0, int seconds=0, int minutes=0, int hours=0, int days=0)
Create a new timer object and start it in one shot mode for the specified amount of time...
static PTimeInterval Tick()
Get the number of milliseconds since some arbtrary point in time.
PBoolean IsPaused() const
Determine if the timer is currently paused.
static unsigned Resolution()
Get the smallest number of milliseconds that the timer can be set to.
IDType GetTimerId() const
Definition: timer.h:383
PInt64 GetAbsoluteTime() const
Return absolute time timer will expire.
Definition: timer.h:379
PTimeInterval GetRemaining() const
Return the real time remaining before expiry.
This class defines a thread of execution in the system.
Definition: thread.h:66
PInt64 GetMilliSeconds() const
Return number of milliseconds left in timer.
A class represeting a simple timer.
Definition: timer.h:58
PSimpleTimer(long milliseconds=0, int seconds=0, int minutes=0, int hours=0, int days=0)
Create a new timer object which will be expired the specified time interval after "now" in real time...
PAtomicBase::IntegerType IntegerType
Definition: critsec.h:174
const PNotifier & GetNotifier() const
Get the current call back function that is called whenever the timer expires.
void Resume()
Restart a paused timer continuing at the time it was paused.
void SetNotifier(const PNotifier &func)
Set the call back function that is called whenever the timer expires.
void Reset()
Restart a timer continuing from the time it was initially.
const PTimeInterval & GetResetTime() const
Get the time this timer was set to initially.
unsigned IDType
Definition: timer.h:186