| Provides mechanism to monitor the time. It creates and defines a timer The
interface is standard. Here is an
example: /** Return the current time of the system since the application startup in second */
double tal_GetTime(void);
/** Create a timer.
* The timer can call a callback function <TO BE CONFIRMED: in a new thread> upon timer expiration
* fct can be NULL if no function needs to be called when timer expires
* arg can be NULL if no argument needs to be transmitted to the callback function
*/
TimerId tal_CreateTimer(void* (*fct)(void*), void* arg);
/** Set the period of the timer and start it.
* The function returns immediately and the caller need to call tal_WaitTimer() to wait for the timer expiration */
status tal_SetTimer(TimerId id, TimeVal value, bool periodic);
/** Suspend the current thread and wait for the timer expiration */
status tal_WaitTimer(timerId id);
/** Cancel a running timer */
status tal_CancelTimer(timerId id);
/** Delete a timer */
status tal_DeleteTimer(TimerId id); As an example, the timing
mechanism implementation can be based on POSIX timer. Example of POSIX timer
usage for implementation purpose: https://gist.github.com/cirocosta/ab2b73b2e1bb34b83f52 https://man7.org/linux/man-pages/man2/timer_create.2.html |