| 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 "base/profiler/tracked_time.h" | 5 #include "base/profiler/tracked_time.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #if defined(OS_WIN) | |
| 10 #include <mmsystem.h> // Declare timeGetTime()... after including build_config. | |
| 11 #endif | |
| 12 | |
| 13 namespace tracked_objects { | 9 namespace tracked_objects { |
| 14 | 10 |
| 15 Duration::Duration() : ms_(0) {} | 11 Duration::Duration() : ms_(0) {} |
| 16 Duration::Duration(int32 duration) : ms_(duration) {} | 12 Duration::Duration(int32 duration) : ms_(duration) {} |
| 17 | 13 |
| 18 Duration& Duration::operator+=(const Duration& other) { | 14 Duration& Duration::operator+=(const Duration& other) { |
| 19 ms_ += other.ms_; | 15 ms_ += other.ms_; |
| 20 return *this; | 16 return *this; |
| 21 } | 17 } |
| 22 | 18 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 return Duration(ms_ - other.ms_); | 54 return Duration(ms_ - other.ms_); |
| 59 } | 55 } |
| 60 | 56 |
| 61 TrackedTime TrackedTime::operator+(const Duration& other) const { | 57 TrackedTime TrackedTime::operator+(const Duration& other) const { |
| 62 return TrackedTime(ms_ + other.ms_); | 58 return TrackedTime(ms_ + other.ms_); |
| 63 } | 59 } |
| 64 | 60 |
| 65 bool TrackedTime::is_null() const { return ms_ == 0; } | 61 bool TrackedTime::is_null() const { return ms_ == 0; } |
| 66 | 62 |
| 67 } // namespace tracked_objects | 63 } // namespace tracked_objects |
| OLD | NEW |