Don't explicitly protect against non-monotonic gettimeofday.

Since we're now protecting against non-monotonic time unconditionally,
there's no need for additional protection in the gettimeofday case.
This commit is contained in:
Juliusz Chroboczek 2011-03-30 00:29:07 +00:00
parent c0ef0f50ad
commit 7b06392812
1 changed files with 0 additions and 7 deletions

View File

@ -141,15 +141,8 @@ static uint64_t GetMicroseconds()
}
#endif
{
static time_t offset = 0, previous = 0;
struct timeval tv;
rc = gettimeofday(&tv, NULL);
tv.tv_sec += offset;
if (previous > tv.tv_sec) {
offset += previous - tv.tv_sec;
tv.tv_sec = previous;
}
previous = tv.tv_sec;
return uint64(tv.tv_sec) * 1000000 + tv.tv_usec;
}
}