| 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 #include "net/quic/core/quic_time.h" | 5 #include "net/quic/core/quic_time.h" |
| 6 | 6 |
| 7 #include <cinttypes> | 7 #include <cinttypes> |
| 8 #include <cstdlib> | 8 #include <cstdlib> |
| 9 #include <limits> | 9 #include <limits> |
| 10 | 10 |
| 11 #include "base/logging.h" | |
| 12 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 13 | 12 |
| 14 using base::StringPrintf; | 13 using base::StringPrintf; |
| 15 using std::string; | 14 using std::string; |
| 16 | 15 |
| 17 namespace net { | 16 namespace net { |
| 18 | 17 |
| 19 string QuicTime::Delta::ToDebugValue() const { | 18 string QuicTime::Delta::ToDebugValue() const { |
| 20 const int64_t one_ms = 1000; | 19 const int64_t one_ms = 1000; |
| 21 const int64_t one_s = 1000 * one_ms; | 20 const int64_t one_s = 1000 * one_ms; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // TODO(ianswett) Test this. | 78 // TODO(ianswett) Test this. |
| 80 QuicWallTime QuicWallTime::Subtract(QuicTime::Delta delta) const { | 79 QuicWallTime QuicWallTime::Subtract(QuicTime::Delta delta) const { |
| 81 uint64_t microseconds = microseconds_ - delta.ToMicroseconds(); | 80 uint64_t microseconds = microseconds_ - delta.ToMicroseconds(); |
| 82 if (microseconds > microseconds_) { | 81 if (microseconds > microseconds_) { |
| 83 microseconds = 0; | 82 microseconds = 0; |
| 84 } | 83 } |
| 85 return QuicWallTime(microseconds); | 84 return QuicWallTime(microseconds); |
| 86 } | 85 } |
| 87 | 86 |
| 88 } // namespace net | 87 } // namespace net |
| OLD | NEW |