Use clock_gettime for all time requests

master
Kenny Levinsen 2020-10-21 00:49:35 +02:00
parent 0703fbcc0e
commit 0da97df89e
1 changed files with 3 additions and 1 deletions

4
main.c
View File

@ -59,7 +59,9 @@ static inline void init_time(void) {
tzset();
}
static inline time_t get_time_sec(void) {
return time(NULL);
struct timespec realtime;
clock_gettime(CLOCK_REALTIME, &realtime);
return realtime.tv_sec;
}
static inline void adjust_timerspec(struct itimerspec *timerspec) {
(void)timerspec;