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

Unified Diff: webrtc/base/timeutils.h

Issue 1793553002: Using 64-bit timestamp in webrtc/p2p (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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/base/timeutils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/timeutils.h
diff --git a/webrtc/base/timeutils.h b/webrtc/base/timeutils.h
index 3ade43094708c92e02e075522a4da151b7712059..f0269b572fced331fc304d0773958fd838d68efc 100644
--- a/webrtc/base/timeutils.h
+++ b/webrtc/base/timeutils.h
@@ -34,8 +34,19 @@ static const int64_t kJan1970AsNtpMillisecs = INT64_C(2208988800000);
typedef uint32_t TimeStamp;
+// Returns the current time in milliseconds in 32 bits.
+uint32_t Time32();
+
+// Returns the current time in milliseconds in 64 bits.
+int64_t Time64();
+
// Returns the current time in milliseconds.
-uint32_t Time();
+// TODO(honghaiz): Returns Time64 once majority of the webrtc code migrates to
+// 64-bit timestamp.
+inline uint32_t Time() {
+ return Time32();
+}
+
// Returns the current time in microseconds.
uint64_t TimeMicros();
// Returns the current time in nanoseconds.
@@ -68,6 +79,10 @@ inline uint32_t TimeMin(uint32_t ts1, uint32_t ts2) {
// timestamps. The value is negative if 'later' occurs before 'earlier'.
int32_t TimeDiff(uint32_t later, uint32_t earlier);
+// Number of milliseconds that would elapse between 'earlier' and 'later'
+// timestamps. The value is negative if 'later' occurs before 'earlier'.
+int64_t TimeDiff64(int64_t later, int64_t earlier);
+
// The number of milliseconds that have elapsed since 'earlier'.
inline int32_t TimeSince(uint32_t earlier) {
return TimeDiff(Time(), earlier);
« no previous file with comments | « no previous file | webrtc/base/timeutils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698