9 #ifndef __SERI_TIME_H__ 10 #define __SERI_TIME_H__ 23 #include "core/itimer.h" 25 #include "core/time.h" 34 #define NUM_SECONDS_IN_MIN (60) 39 #define NUM_MILLIS_IN_SEC (1000) 44 #define NUM_NANOS_IN_USEC (1000) 49 #define NUM_NANOS_IN_MILLI (1000000L) 54 #define NUM_NANOS_IN_SEC (1000000000ULL) 103 int nanosleep(
const struct timespec *req,
struct timespec *rem);
125 #ifndef __HIDE_INTERNAL_FUNCTIONS__ 132 int alarm(
unsigned int seconds);
146 int setitimer(
int which,
const struct itimerval *new_value,
147 struct itimerval *old_value);
159 int getitimer(
int which,
struct itimerval *curr_value);
176 void timeadd(
const struct timespec *a,
177 const struct timespec *b,
178 struct timespec *res);
186 void timesub(
const struct timespec *a,
187 const struct timespec *b,
188 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:67
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:66
long long time_t
Definition: types.h:33
int tm_mon
Definition: time.h:68
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:64
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:70
int tm_min
Definition: time.h:65
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:72
int tm_yday
Definition: time.h:71
int tm_year
Definition: time.h:69