Time types. More...
Go to the source code of this file.
Data Structures | |
struct | timespec |
represents an elapsed time More... | |
struct | itimerspec |
timer More... | |
struct | tm |
calendar representation of time More... | |
Macros | |
Unit conversion constants. | |
#define | MICROSECONDS_PER_SECOND ( 1000000LL ) |
#define | NANOSECONDS_PER_SECOND ( 1000000000LL ) |
#define | NANOSECONDS_PER_TICK ( NANOSECONDS_PER_SECOND / configTICK_RATE_HZ ) |
Clock identifiers. | |
#define | CLOCK_REALTIME 0 |
#define | CLOCK_MONOTONIC 1 |
A number used to convert the value returned by the clock() function into seconds. | |
#define | CLOCKS_PER_SEC ( ( clock_t ) configTICK_RATE_HZ ) |
Flag indicating time is absolute. | |
For functions taking timer objects, this refers to the clock associated with the timer. | |
#define | TIMER_ABSTIME 0x01 |
Functions | |
clock_t | clock (void) |
Report CPU time used. More... | |
int | clock_getcpuclockid (pid_t pid, clockid_t *clock_id) |
Access a process CPU-time clock. More... | |
int | clock_getres (clockid_t clock_id, struct timespec *res) |
Returns the resolution of a clock. More... | |
int | clock_gettime (clockid_t clock_id, struct timespec *tp) |
Returns the current value for the specified clock, clock_id. More... | |
int | clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *rqtp, struct timespec *rmtp) |
High resolution sleep with specifiable clock. More... | |
int | clock_settime (clockid_t clock_id, const struct timespec *tp) |
Sets the time for the specified clock. More... | |
struct tm * | localtime_r (const time_t *timer, struct tm *result) |
Convert a time value to a broken-down local time. More... | |
int | nanosleep (const struct timespec *rqtp, struct timespec *rmtp) |
High resolution sleep. More... | |
size_t | strftime (char *s, size_t maxsize, const char *format, const struct tm *timeptr) |
Convert date and time to a string. More... | |
time_t | time (time_t *tloc) |
Get time. More... | |
int | timer_create (clockid_t clockid, struct sigevent *evp, timer_t *timerid) |
Create a per-process timer. More... | |
int | timer_delete (timer_t timerid) |
Delete a per-process timer. More... | |
int | timer_getoverrun (timer_t timerid) |
Get the timer overrun count. More... | |
int | timer_gettime (timer_t timerid, struct itimerspec *value) |
Get the amount of time until the timer expires. More... | |
int | timer_settime (timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue) |
Set the time until the next expiration of the timer. More... | |
#define MICROSECONDS_PER_SECOND ( 1000000LL ) |
Microseconds per second.
#define NANOSECONDS_PER_SECOND ( 1000000000LL ) |
Nanoseconds per second.
#define NANOSECONDS_PER_TICK ( NANOSECONDS_PER_SECOND / configTICK_RATE_HZ ) |
Nanoseconds per FreeRTOS tick.
#define CLOCK_REALTIME 0 |
The identifier of the system-wide clock measuring real time.
#define CLOCK_MONOTONIC 1 |
The identifier for the system-wide monotonic clock.
clock_t clock | ( | void | ) |
Report CPU time used.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock.html
Access a process CPU-time clock.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_getcpuclockid.html
EPERM |
Returns the resolution of a clock.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_getres.html
0 | - Upon successful execution |
Returns the current value for the specified clock, clock_id.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_gettime.html
0 | - Upon successful completion. |
int clock_nanosleep | ( | clockid_t | clock_id, |
int | flags, | ||
const struct timespec * | rqtp, | ||
struct timespec * | rmtp | ||
) |
High resolution sleep with specifiable clock.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_nanosleep.html
0 | - Upon successful completion. |
EINVAL | - The rqtp argument specified a nanosecond value less than zero or greater than or equal to 1000 million. |
Sets the time for the specified clock.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_settime.html
-1 | with errno set to EPERM. |
Convert a time value to a broken-down local time.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/localtime_r.html
High resolution sleep.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/nanosleep.html
0 | - Upon successful completion. |
-1 | - The rqtp argument is invalid OR the rqtp argument specified a nanosecond value less than zero or greater than or equal to 1000 million. |
size_t strftime | ( | char * | s, |
size_t | maxsize, | ||
const char * | format, | ||
const struct tm * | timeptr | ||
) |
Convert date and time to a string.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/strftime.html
the | number of bytes placed into the array pointed to by s, if the total number of resulting bytes including the terminating null byte is not more than maxsize. |
0,otherwise. | In this case, the array pointed to by s contains partially copied data. |
Get time.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/time.html
FreeRTOS | tick count - upon successful completion |
Create a per-process timer.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/timer_create.html
0 | - Upon successful completion, with location referenced by timerid updated. |
-1 | - If an error occurs. errno is also set. |
int timer_delete | ( | timer_t | timerid | ) |
Delete a per-process timer.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/timer_delete.html
0 | - Upon successful completion. |
int timer_getoverrun | ( | timer_t | timerid | ) |
Get the timer overrun count.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/timer_getoverrun.html
0 | - Always return 0, since signals are not supported. |
int timer_gettime | ( | timer_t | timerid, |
struct itimerspec * | value | ||
) |
Get the amount of time until the timer expires.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/timer_gettime.html
0 | - Upon successful completion. |
int timer_settime | ( | timer_t | timerid, |
int | flags, | ||
const struct itimerspec * | value, | ||
struct itimerspec * | ovalue | ||
) |
Set the time until the next expiration of the timer.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/timer_settime.html
0 | - Upon successful completion. |
-1 | - An error occured, errno is also set. |