#include <signal.h>
#include <stdint.h>
#include <sys/types.h>
Go to the source code of this file.
|
#define | CLOCK_REALTIME 0 |
|
#define | CLOCK_MONOTONIC 1 |
|
◆ clock_getres()
int clock_getres |
( |
clockid_t |
clockid, |
|
|
struct timespec * |
res |
|
) |
| |
Get the resolution (precision) of the specified clock ID.
- Parameters
-
clk_id | The clock ID to provide. |
res | The time object for returning the clock resolution. |
- Return values
-
int | 0 on success and nonzero error number on error. |
◆ clock_gettime()
int clock_gettime |
( |
clockid_t |
clockid, |
|
|
struct timespec * |
tp |
|
) |
| |
Retrieve the time of the specified clock ID.
- Parameters
-
clk_id | The clock ID to provide. |
tp | The time object for returning the time. |
- Return values
-
int | 0 on success and nonzero error number on error. |
◆ clock_settime()
int clock_settime |
( |
clockid_t |
clockid, |
|
|
const struct timespec * |
tp |
|
) |
| |
Set the time of the specified clock ID.
- Parameters
-
clk_id | The clock ID to provide. |
tp | The time object for setting the clock. |
- Return values
-
int | 0 on success and nonzero error number on error. |
◆ timer_create()
int timer_create |
( |
clockid_t |
clockid, |
|
|
struct sigevent * |
sevp, |
|
|
timer_t * |
timerid |
|
) |
| |
Create a new per-thread interval timer.
- Parameters
-
clk_id | The clock ID to provide. |
sevp | For signaling an event when the timer expired. |
timerid | For returning the ID of the newly created timer. |
- Return values
-
int | 0 on success and nonzero error number on error. |
◆ timer_delete()
int timer_delete |
( |
timer_t |
timerid | ) |
|
Delete the timer specified with the timer ID.
- Parameters
-
timerid | The timer ID to provide. |
- Return values
-
int | 0 on success and nonzero error number on error. |
◆ timer_gettime()
int timer_gettime |
( |
timer_t |
timerid, |
|
|
struct itimerspec * |
curr_value |
|
) |
| |
Return the timer interval and the time until next expiration.
- Parameters
-
timerid | The timer ID to provide. |
curr_value | The timer object for returning the timer time. |
- Return values
-
int | 0 on success and nonzero error number on error. |
◆ timer_settime()
int timer_settime |
( |
timer_t |
timerid, |
|
|
int |
flags, |
|
|
const struct itimerspec * |
new_value, |
|
|
struct itimerspec * |
old_value |
|
) |
| |
Arm or disarm the timer specified by the timer ID.
- Parameters
-
timerid | The timer ID to provide. |
flags | Not used. |
new_value | Pointer the the new timer setting. |
old_value | Pointer to the memory space for storing the old timer setting. |
- Return values
-
int | 0 on success and nonzero error number on error. |