Using 64-bit timestamp to replace the 32-bit one in webrtc/p2p.
Also changed from unsigned to signed integer per the style guide.
By the way, I kept all delta-times to be 32-bit int.
The only things left in the p2p dir are
1. proberprober/main.cc where Time() is used as the input for a random number.
2. pseudotcp.cc: where 32-bit time info is sent over the wire.
BUG=webrtc:5636
Review URL: https://codereview.webrtc.org/1793553002
Cr-Commit-Position: refs/heads/master@{#12019}
diff --git a/webrtc/base/timeutils.cc b/webrtc/base/timeutils.cc
index b7803ae..0c40c52 100644
--- a/webrtc/base/timeutils.cc
+++ b/webrtc/base/timeutils.cc
@@ -80,10 +80,14 @@
return ticks;
}
-uint32_t Time() {
+uint32_t Time32() {
return static_cast<uint32_t>(TimeNanos() / kNumNanosecsPerMillisec);
}
+int64_t Time64() {
+ return static_cast<int64_t>(TimeNanos() / kNumNanosecsPerMillisec);
+}
+
uint64_t TimeMicros() {
return static_cast<uint64_t>(TimeNanos() / kNumNanosecsPerMicrosec);
}
@@ -192,6 +196,10 @@
#endif
}
+int64_t TimeDiff64(int64_t later, int64_t earlier) {
+ return later - earlier;
+}
+
TimestampWrapAroundHandler::TimestampWrapAroundHandler()
: last_ts_(0), num_wrap_(-1) {}