- gettimeofday(&tv_s, NULL);
- base.tv_sec = t.tv_sec = tv_s.tv_sec;
- base.tv_nsec = t.tv_nsec = tv_s.tv_usec * 1000;
+#ifdef CONFIG_PTHREAD_CONDATTR_SETCLOCK
+ clock_gettime(CLOCK_MONOTONIC, &t);
+#else
+ clock_gettime(CLOCK_REALTIME, &t);
+#endif
+
+ base = t;