00001 #ifndef FAKE_CLOCK_GETTIME_H 00002 #define FAKE_CLOCK_GETTIME_H 00003 #include <time.h> 00004 00005 #define CLOCK_REALTIME 0 00006 int clock_gettime(int clk_id, struct timespec *tp) 00007 { 00008 /* timespec { tv_sec, tv_nsec } */ 00009 /* timeval { tv_sec; tv_usec } */ 00010 int rs; 00011 struct timeval tv; 00012 rs = gettimeofday(&tv, NULL); 00013 tp->tv_sec = tv.tv_sec; 00014 tp->tv_nsec = tv.tv_usec * 1000; 00015 return rs; 00016 } 00017 #endif FAKE_CLOCK_GETTIME_H
1.3.9.1