| Index: base/time_posix.cc
|
| diff --git a/base/time_posix.cc b/base/time_posix.cc
|
| index c64f8e7aacd381a9ea4990b0d1c75ad881ad9e47..af7ee250e053c7e77508ff2690ac027edbdb1e6e 100644
|
| --- a/base/time_posix.cc
|
| +++ b/base/time_posix.cc
|
| @@ -14,6 +14,7 @@
|
|
|
| namespace base {
|
|
|
| +#if !defined(OS_MACOSX)
|
| // The Time routines in this file use standard POSIX routines, or almost-
|
| // standard routines in the case of timegm. We need to use a Mach-specific
|
| // function for TimeTicks::Now() on Mac OS X.
|
| @@ -174,4 +175,19 @@ TimeTicks TimeTicks::HighResNow() {
|
| return Now();
|
| }
|
|
|
| +#endif // !OS_MACOSX
|
| +
|
| +struct timespec TimeDelta::ToTimeSpec() const {
|
| + int64 microseconds = InMicroseconds();
|
| + time_t seconds = 0;
|
| + if (microseconds >= Time::kMicrosecondsPerSecond) {
|
| + seconds = InSeconds();
|
| + microseconds -= seconds * Time::kMicrosecondsPerSecond;
|
| + }
|
| + struct timespec result =
|
| + {seconds,
|
| + microseconds * Time::kNanosecondsPerMicrosecond};
|
| + return result;
|
| +}
|
| +
|
| } // namespace base
|
|
|