libcmutils 0.6.5
Multi-platform C99 utility library
Loading...
Searching...
No Matches
Scheduled and repeating tasks.

Data Structures

struct  CMUTIL_TimerTask
 Timer task handle. More...
 
struct  CMUTIL_Timer
 Timer object for scheduling tasks. More...
 

Macros

#define CMUTIL_TIMER_PRECISION   1
 
#define CMUTIL_TIMER_THREAD   2
 
#define CMUTIL_TimerCreate()    CMUTIL_TimerCreateEx(CMUTIL_TIMER_PRECISION, CMUTIL_TIMER_THREAD)
 Create a timer object with default settings.
 

Functions

CMUTIL_TimerCMUTIL_TimerCreateEx (long precision, int threads)
 Create a timer object with custom settings.
 

Detailed Description

Macro Definition Documentation

◆ CMUTIL_TIMER_PRECISION

#define CMUTIL_TIMER_PRECISION   1

Default timer precision in milliseconds.

◆ CMUTIL_TIMER_THREAD

#define CMUTIL_TIMER_THREAD   2

Default number of threads for the timer.

◆ CMUTIL_TimerCreate

#define CMUTIL_TimerCreate ( )     CMUTIL_TimerCreateEx(CMUTIL_TIMER_PRECISION, CMUTIL_TIMER_THREAD)

Create a timer object with default settings.

This macro creates a timer object using the default precision and number of threads.

Returns
A pointer to the newly created CMUTIL_Timer object, or NULL on failure.

Function Documentation

◆ CMUTIL_TimerCreateEx()

CMUTIL_Timer * CMUTIL_TimerCreateEx ( long  precision,
int  threads 
)

Create a timer object with custom settings.

Parameters
precisionThe precision of the timer in milliseconds.
threadsThe number of threads to use for the timer.
Returns
A pointer to the newly created CMUTIL_Timer object, or NULL on failure.