OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // QuicTime represents one point in time, stored in microsecond resolution. | 5 // QuicTime represents one point in time, stored in microsecond resolution. |
6 // QuicTime is monotonically increasing, even across system clock adjustments. | 6 // QuicTime is monotonically increasing, even across system clock adjustments. |
7 // The epoch (time 0) of QuicTime is unspecified. | 7 // The epoch (time 0) of QuicTime is unspecified. |
8 // | 8 // |
9 // This implementation wraps the classes base::TimeTicks and base::TimeDelta. | 9 // This implementation wraps the classes base::TimeTicks and base::TimeDelta. |
10 | 10 |
11 #ifndef NET_QUIC_QUIC_TIME_H_ | 11 #ifndef NET_QUIC_QUIC_TIME_H_ |
12 #define NET_QUIC_QUIC_TIME_H_ | 12 #define NET_QUIC_QUIC_TIME_H_ |
13 | 13 |
14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
16 #include "net/base/net_export.h" | 16 #include "net/base/net_export.h" |
17 | 17 |
18 namespace net { | 18 namespace net { |
19 | 19 |
20 static const uint64 kNumMicrosPerSecond = base::Time::kMicrosecondsPerSecond; | 20 static const uint64 kNumMicrosPerSecond = base::Time::kMicrosecondsPerSecond; |
| 21 static const uint64 kNumMicrosPerMilli = |
| 22 base::Time::kMicrosecondsPerMillisecond; |
21 | 23 |
22 // A QuicTime is a purely relative time. QuicTime values from different clocks | 24 // A QuicTime is a purely relative time. QuicTime values from different clocks |
23 // cannot be compared to each other. If you need an absolute time, see | 25 // cannot be compared to each other. If you need an absolute time, see |
24 // QuicWallTime, below. | 26 // QuicWallTime, below. |
25 class NET_EXPORT_PRIVATE QuicTime { | 27 class NET_EXPORT_PRIVATE QuicTime { |
26 public: | 28 public: |
27 // A QuicTime::Delta represents the signed difference between two points in | 29 // A QuicTime::Delta represents the signed difference between two points in |
28 // time, stored in microsecond resolution. | 30 // time, stored in microsecond resolution. |
29 class NET_EXPORT_PRIVATE Delta { | 31 class NET_EXPORT_PRIVATE Delta { |
30 public: | 32 public: |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 inline bool operator<=(QuicTime lhs, QuicTime rhs) { | 189 inline bool operator<=(QuicTime lhs, QuicTime rhs) { |
188 return !(rhs < lhs); | 190 return !(rhs < lhs); |
189 } | 191 } |
190 inline bool operator>=(QuicTime lhs, QuicTime rhs) { | 192 inline bool operator>=(QuicTime lhs, QuicTime rhs) { |
191 return !(lhs < rhs); | 193 return !(lhs < rhs); |
192 } | 194 } |
193 | 195 |
194 } // namespace net | 196 } // namespace net |
195 | 197 |
196 #endif // NET_QUIC_QUIC_TIME_H_ | 198 #endif // NET_QUIC_QUIC_TIME_H_ |
OLD | NEW |