40 #include "sys/clock.h" 45 typedef struct clock_timespec_s {
51 get_time(clock_timespec_t *spec)
53 #if defined(__linux__) || (defined(__MACH__) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200) 56 clock_gettime(CLOCK_MONOTONIC, &ts);
58 spec->tv_sec = ts.tv_sec;
59 spec->tv_nsec = ts.tv_nsec;
63 gettimeofday(&tv, NULL);
65 spec->tv_sec = tv.tv_sec;
66 spec->tv_nsec = tv.tv_usec * 1000;
unsigned long clock_seconds(void)
Get the current value of the platform seconds.
#define CLOCK_SECOND
A second, measured in system clock time.
void clock_delay(unsigned int i)
Obsolete delay function but we implement it here since some code still uses it.
clock_time_t clock_time(void)
Get the current clock time.
void clock_init(void)
Arch-specific implementation of clock_init for the cc2538.