Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(664)

Unified Diff: webrtc/base/timeutils.cc

Issue 1639543005: Use rtc::time for all your timing needs! (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Format Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/system_wrappers/source/tick_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/timeutils.cc
diff --git a/webrtc/base/timeutils.cc b/webrtc/base/timeutils.cc
index 05e9ad8243be1eb9447f468bc0fae0955263eed2..a24f2299ce59374865b80667b23ea01fcf4a49ad 100644
--- a/webrtc/base/timeutils.cc
+++ b/webrtc/base/timeutils.cc
@@ -74,6 +74,11 @@ uint64_t TimeNanos() {
// TODO: Calculate with nanosecond precision. Otherwise, we're just
// wasting a multiply and divide when doing Time() on Windows.
ticks = ticks * kNumNanosecsPerMillisec;
+#else
pbos-webrtc 2016/01/26 15:00:22 #else #error? Do we ever build with none of these
sprang_webrtc 2016/01/27 08:48:47 Agreed it makes more sense to have #error here ins
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ ticks =
+ (kNumNanosecsPerSec * tv.tv_sec) + (kNumNanosecsPerMicrosec * tv.tv_usec);
#endif
return ticks;
}
« no previous file with comments | « no previous file | webrtc/system_wrappers/source/tick_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698