9 #ifndef __SERI_TIME_H__ 10 #define __SERI_TIME_H__ 12 #include "core/time.h" 21 #define NUM_SECONDS_IN_MIN (60) 26 #define NUM_MILLIS_IN_SEC (1000) 31 #define NUM_NANOS_IN_USEC (1000) 36 #define NUM_NANOS_IN_MILLI (1000000L) 41 #define NUM_NANOS_IN_SEC (1000000000ULL) 90 int nanosleep(
const struct timespec *req,
struct timespec *rem);
112 #ifndef __HIDE_INTERNAL_FUNCTIONS__ 119 int alarm(
unsigned int seconds);
136 void timeadd(
const struct timespec *a,
137 const struct timespec *b,
138 struct timespec *res);
146 void timesub(
const struct timespec *a,
147 const struct timespec *b,
148 struct timespec *res);
void timeadd(const struct timespec *a, const struct timespec *b, struct timespec *res)
The function adds two dates.
uint64_t timespec_to_nsec(const struct timespec *a)
The function converts time from timespec format to nanoseconds.
int tm_mday
Definition: time.h:54
Wrapper for kernel types.h header.
void ms_to_timespec(int64_t t, struct timespec *a)
The function converts time in milliseconds to to timespec format.
int tm_hour
Definition: time.h:53
long long time_t
Definition: types.h:33
int tm_mon
Definition: time.h:55
int clock_gettime(clockid_t clk_id, struct timespec *ts)
The function retrieves the time of the specified clock clk_id. This function is non-blocking, except CLOCK_REE case. In this case function can sleep and can be interrupted with -1 result and EINTR errno.
int nanosleep(const struct timespec *req, struct timespec *rem)
nanosleep() suspends the execution of the calling thread until either at least the time specified in ...
int tm_sec
Definition: time.h:51
void timesub(const struct timespec *a, const struct timespec *b, struct timespec *res)
The function subtracts two dates.
unsigned int arm_timer_get_frequency(void)
The function retrieves the frequency of ARM timer.
int tm_wday
Definition: time.h:57
int tm_min
Definition: time.h:52
int64_t timespec_to_ms(const struct timespec *a)
The function converts time from timespec format to milliseconds.
time_t time(time_t *time)
Get the current calendar time as a value of type time_t.
int tm_isdst
Definition: time.h:59
int tm_yday
Definition: time.h:58
int tm_year
Definition: time.h:56