#include <sys/types.h>


Go to the source code of this file.
Data Structures | |
| struct | timeval |
| Time value accurate to microseconds. More... | |
| struct | timespec |
| Time value accurate to nanoseconds. More... | |
| struct | timezone |
| Time zone. More... | |
Defines | |
| #define | _ABLE_CLIB_SYS_TIME_H 1 |
| #define | timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) |
| #define | timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) |
| #define | timercmp(a, b, CMP) |
| #define | timeradd(a, b, result) |
| #define | timersub(a, b, result) |
Functions | |
| int | gettimeofday (struct timeval *tv, struct timezone *tz) |
| Get the current time of day. | |
| int | settimeofday (const struct timeval *tv, const struct timezone *tz) |
| Set the current time of day. | |
| #define _ABLE_CLIB_SYS_TIME_H 1 |
| #define timeradd | ( | a, | |||
| b, | |||||
| result | ) |
Value:
do { \ (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \ (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \ while ((result)->tv_usec >= 1000000) { \ ++(result)->tv_sec; \ (result)->tv_usec -= 1000000; \ } \ } while (0)
| #define timerclear | ( | tvp | ) | ((tvp)->tv_sec = (tvp)->tv_usec = 0) |
| #define timercmp | ( | a, | |||
| b, | |||||
| CMP | ) |
Value:
(((a)->tv_sec == (b)->tv_sec) ? \
((a)->tv_usec CMP (b)->tv_usec) : \
((a)->tv_sec CMP (b)->tv_sec))
| #define timerisset | ( | tvp | ) | ((tvp)->tv_sec || (tvp)->tv_usec) |
| #define timersub | ( | a, | |||
| b, | |||||
| result | ) |
Value:
do { \ (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ while ((result)->tv_usec < 0) { \ --(result)->tv_sec; \ (result)->tv_usec += 1000000; \ } \ } while (0)
Set the current time of day.
1.5.6