poser
A C framework for POsix SERvices
|
A timer. More...
#include <poser/core/timer.h>
Public Member Functions | |
PSC_Timer * | PSC_Timer_create (void) |
PSC_Timer default constructor. | |
PSC_Event * | PSC_Timer_expired (PSC_Timer *self) |
The timer expired. | |
void | PSC_Timer_setMs (PSC_Timer *self, unsigned ms) |
Set expiry in milliseconds. | |
void | PSC_Timer_start (PSC_Timer *self, int periodic) |
Start the timer. | |
void | PSC_Timer_stop (PSC_Timer *self) |
Stop the timer. | |
void | PSC_Timer_destroy (PSC_Timer *self) |
PSC_Timer destructor. | |
A timer.
PSC_Timer * PSC_Timer_create | ( | void | ) |
void PSC_Timer_destroy | ( | PSC_Timer * | self | ) |
The timer expired.
This event is fired on each expiry of the timer.
self | the PSC_Timer |
void PSC_Timer_setMs | ( | PSC_Timer * | self, |
unsigned | ms | ||
) |
Set expiry in milliseconds.
Sets the expiry time in milliseconds. If the timer is currently running, it is first stopped and then restarted with the new value. The initial value is 1000 milliseconds (1 second).
self | the PSC_Timer |
ms | expiry in milliseconds |
void PSC_Timer_start | ( | PSC_Timer * | self, |
int | periodic | ||
) |
Start the timer.
Starts the timer. An expired event will be fired after the configured. If the timer is already running, stops and restarts it. expiry time.
self | the PSC_Timer |
periodic | if nonzero, expire periodically until explicitly stopped. |
void PSC_Timer_stop | ( | PSC_Timer * | self | ) |
Stop the timer.
Stops the timer. No further expired events will occur until PSC_Timer_start() is called again.
self | the PSC_Timer |