summaryrefslogtreecommitdiff
path: root/code/ecp/posix/time.c
blob: 45d827e49e27a4cf890790f33e30d4458e48c61c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <unistd.h>
#include <sys/time.h>

#include <core.h>
#include <tm.h>

ecp_cts_t ecp_tm_abstime_ms(ecp_cts_t msec) {
    struct timeval tv;
    ecp_cts_t ms_now;
    
    gettimeofday(&tv, NULL);
    ms_now = tv.tv_sec * 1000 + tv.tv_usec / 1000;
    return ms_now + msec;
}

void ecp_tm_sleep_ms(ecp_cts_t msec) {
    usleep(msec*1000);
}

void ecp_tm_timer_set(ecp_cts_t next) {}