blob: 8f174ed9f6e5b682ff9d5ce8a8ae6628ec0ee042 [file] [log] [blame]
#include <stdlib.h>
#include <sys/time.h>
int portable_clock_gettime(struct timespec *ts)
{
struct timeval tv;
gettimeofday(&tv, NULL);
ts->tv_sec = tv.tv_sec;
ts->tv_nsec = tv.tv_usec * 1000UL;
return 0;
}