Chromium Code Reviews| Index: webrtc/base/timeutils.cc |
| diff --git a/webrtc/base/timeutils.cc b/webrtc/base/timeutils.cc |
| index de3e6afb28d824ecb9dfc26f1029dd0d0958fd24..a43158712d7776a0cb88bece684a8d6c369b6422 100644 |
| --- a/webrtc/base/timeutils.cc |
| +++ b/webrtc/base/timeutils.cc |
| @@ -32,7 +32,16 @@ namespace rtc { |
| const uint32_t HALF = 0x80000000; |
| +ClockInterface* clock_ = nullptr; |
| + |
| +void SetClock(ClockInterface* clock) { |
| + clock_ = clock; |
| +} |
| + |
| uint64_t TimeNanos() { |
| + if (clock_) { |
|
juberti2
2016/04/25 20:18:23
Do we need to mention that this is unsynchronized?
Taylor Brandstetter
2016/04/26 01:22:32
I mention in timeutils.h that SetClock (which is t
|
| + return clock_->TimeNanos(); |
| + } |
| int64_t ticks = 0; |
| #if defined(WEBRTC_MAC) |
|
juberti2
2016/04/25 20:18:23
Should we factor this into a real clock implementa
Taylor Brandstetter
2016/04/26 01:22:32
Done.
|
| static mach_timebase_info_data_t timebase; |