Change-Id: Iceda877ff4fee12b3fe702aeb3c904b043258a96
if (s_info.type == CLOCK_MONOTONIC) {
s_info.type = CLOCK_REALTIME;
} else if (s_info.type == CLOCK_REALTIME) {
- break;
+ struct timeval tv;
+ if (gettimeofday(&tv, NULL) < 0) {
+ ErrPrint("gettimeofday: %s\n", strerror(errno));
+ break;
+ }
+
+ return tv.tv_sec + tv.tv_usec / 1000000.0f;
}
} while (1);
if (gettimeofday(&tv, NULL) < 0) {
ErrPrint("gettimeofday: %s\n", strerror(errno));
- tv.tv_sec = rand();
- tv.tv_usec = rand();
+ tv.tv_sec = 0;
+ tv.tv_usec = 0;
}
return (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0f;