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

Unified Diff: webrtc/base/timeutils.h

Issue 1835053002: Change default timestamp to 64 bits in all webrtc directories. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Address comments Created 4 years, 8 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
Index: webrtc/base/timeutils.h
diff --git a/webrtc/base/timeutils.h b/webrtc/base/timeutils.h
index 4af0d9538f058f9d969f954cd9a7fb5620463fd7..fe2e0d559d63d09087f5e5218d74f5eec59a5611 100644
--- a/webrtc/base/timeutils.h
+++ b/webrtc/base/timeutils.h
@@ -29,19 +29,16 @@ static const int64_t kNumNanosecsPerMillisec =
static const int64_t kNumNanosecsPerMicrosec =
kNumNanosecsPerSec / kNumMicrosecsPerSec;
-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.
+// TODO(honghaiz): remove this and replace the call with Time().
pthatcher1 2016/05/02 16:57:56 I think it's OK to leave this so callers can be ex
honghaiz3 2016/05/03 21:18:25 Removed this and replaced with TimeMillis()
int64_t Time64();
// Returns the current time in milliseconds.
-// TODO(honghaiz): Returns Time64 once majority of the webrtc code migrates to
-// 64-bit timestamp.
-inline uint32_t Time() {
- return Time32();
+inline int64_t Time() {
+ return Time64();
}
// Returns the current time in microseconds.
@@ -50,37 +47,21 @@ uint64_t TimeMicros();
uint64_t TimeNanos();
// Returns a future timestamp, 'elapsed' milliseconds from now.
-uint32_t TimeAfter(int32_t elapsed);
-
-bool TimeIsLaterOrEqual(uint32_t earlier, uint32_t later); // Inclusive
-bool TimeIsLater(uint32_t earlier, uint32_t later); // Exclusive
-
-// Returns the later of two timestamps.
-inline uint32_t TimeMax(uint32_t ts1, uint32_t ts2) {
- return TimeIsLaterOrEqual(ts1, ts2) ? ts2 : ts1;
-}
-
-// Returns the earlier of two timestamps.
-inline uint32_t TimeMin(uint32_t ts1, uint32_t ts2) {
- return TimeIsLaterOrEqual(ts1, ts2) ? ts1 : ts2;
-}
-
-// Number of milliseconds that would elapse between 'earlier' and 'later'
-// timestamps. The value is negative if 'later' occurs before 'earlier'.
-int32_t TimeDiff(uint32_t later, uint32_t earlier);
+int64_t TimeAfter(int64_t elapsed);
// 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);
+int64_t TimeDiff(int64_t later, int64_t earlier);
+int32_t TimeDiff32(uint32_t later, uint32_t earlier);
// The number of milliseconds that have elapsed since 'earlier'.
-inline int32_t TimeSince(uint32_t earlier) {
- return TimeDiff(Time(), earlier);
+inline int64_t TimeSince(int64_t earlier) {
+ return Time() - earlier;
}
// The number of milliseconds that will elapse between now and 'later'.
-inline int32_t TimeUntil(uint32_t later) {
- return TimeDiff(later, Time());
+inline int64_t TimeUntil(uint64_t later) {
+ return later - Time();
}
class TimestampWrapAroundHandler {

Powered by Google App Engine
This is Rietveld 408576698