Amazon FreeRTOS:
POSIX
|
返回主页↑ |
时间类型。 更多……
数据结构体 | |
struct | timespec |
表示运行时间 更多…… | |
struct | itimerspec |
定时器 更多…… | |
宏 | |
单位转换常数。 | |
#define | MICROSECONDS_PER_SECOND ( 1000000LL ) |
#define | NANOSECONDS_PER_SECOND ( 1000000000LL ) |
#define | NANOSECONDS_PER_TICK ( NANOSECONDS_PER_SECOND / configTICK_RATE_HZ ) |
时钟标识符。 | |
#define | CLOCK_REALTIME 0 |
#define | CLOCK_MONOTONIC 1 |
将 clock() 函数返回的值转换为秒的数值。 | |
#define | CLOCKS_PER_SEC ( ( clock_t ) configTICK_RATE_HZ ) |
指示时间的标志是绝对标志。 | |
对于获取定时器对象的函数,它指的是与定时器关联的时钟。 | |
#define | TIMER_ABSTIME 0x01 |
函数 | |
clock_t | clock (void) |
报告使用的 CPU 时间。 更多…… | |
int | clock_getcpuclockid (pid_t pid, clockid_t *clock_id) |
访问进程 CPU 时钟。 更多…… | |
int | clock_getres (clockid_t clock_id, struct timespec *res) |
返回时钟的分辨率。 更多…… | |
int | clock_gettime (clockid_t clock_id, struct timespec *tp) |
返回指定时钟的当前值,clock_id。 更多…… | |
int | clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *rqtp, struct timespec *rmtp) |
具有可指定时钟的高分辨率睡眠。 更多…… | |
int | clock_settime (clockid_t clock_id, const struct timespec *tp) |
设置指定时钟的时间。 更多…… | |
int | nanosleep (const struct timespec *rqtp, struct timespec *rmtp) |
高分辨率睡眠。 更多…… | |
int | timer_create (clockid_t clockid, struct sigevent *evp, timer_t *timerid) |
创建进程自己的定时器。 更多…… | |
int | timer_delete (timer_t timerid) |
删除每进程定时器。 更多…… | |
int | timer_getoverrun (timer_t timerid) |
获取定时器超限计数。 更多…… | |
int | timer_gettime (timer_t timerid, struct itimerspec *value) |
获取定时器到期前的时间量。 更多…… | |
int | timer_settime (timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue) |
设置定时器下一次到期前的时间。 更多…… | |
#define MICROSECONDS_PER_SECOND ( 1000000LL ) |
每秒的微秒数。
#define NANOSECONDS_PER_SECOND ( 1000000000LL ) |
每秒的纳秒数。
#define NANOSECONDS_PER_TICK ( NANOSECONDS_PER_SECOND / configTICK_RATE_HZ ) |
每 FreeRTOS 滴答的纳秒数。
#define CLOCK_REALTIME 0 |
全系统实时测量时钟标识符。
#define CLOCK_MONOTONIC 1 |
全系统单调时钟标识符。
clock_t clock | ( | void | ) |
报告使用的 CPU 时间。
http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock.html
访问进程 CPU 时钟。
http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_getcpuclockid.html
EPERM |
返回时钟的分辨率。
http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_getres.html
0 | ——成功执行后 |
返回指定时钟的当前值,clock_id。
http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_gettime.html
0 | ——成功完成后 |
int clock_nanosleep | ( | clockid_t | clock_id, |
int | flags, | ||
const struct timespec * | rqtp, | ||
struct timespec * | rmtp | ||
) |
具有可指定时钟的高分辨率睡眠。
http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_nanosleep.html
0 | ——成功完成后 |
EINVAL | —rqtp参数指定的纳秒值小于零或大于等于 10 亿。 |
设置指定时钟的时间。
http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_settime.html
——1 | errno 设置为 EPERM。 |
高分辨率睡眠。
http://pubs.opengroup.org/onlinepubs/9699919799/functions/nanosleep.html
0 | ——成功完成后。 |
——1 | ——rqtp 自变量无效或 rqtp 自变量指定的纳秒值小于 0 或大于或等于 10 亿。 |
创建过程特定定时器。
http://pubs.opengroup.org/onlinepubs/9699919799/functions/timer_create.html
0 | ——成功完成后,定时器引用的位置将更新。 |
-1 | ——如果发生错误,也设置 errno。 |
int timer_delete | ( | timer_t | timerid | ) |
int timer_getoverrun | ( | timer_t | timerid | ) |
获取定时器超限计数。
http://pubs.opengroup.org/onlinepubs/9699919799/functions/timer_getoverrun.html
0 | —因为不支持信号,所以始终返回 0。 |
int timer_gettime | ( | timer_t | timerid, |
struct itimerspec * | value | ||
) |
获取定时器到期前的时间量。
http://pubs.opengroup.org/onlinepubs/9699919799/functions/timer_gettime.html
0 | ——成功完成后 |
int timer_settime | ( | timer_t | timerid, |
int | flags, | ||
const struct itimerspec * | value, | ||
struct itimerspec * | ovalue | ||
) |
设置定时器下一次到期前的时间。
http://pubs.opengroup.org/onlinepubs/9699919799/functions/timer_settime.html
0 | —成功完成后。 |
-1 | —发生错误时,也设置 errno。 |