| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef BASE_PROFILER_TRACKED_TIME_H_ | 5 #ifndef BASE_PROFILER_TRACKED_TIME_H_ |
| 6 #define BASE_PROFILER_TRACKED_TIME_H_ | 6 #define BASE_PROFILER_TRACKED_TIME_H_ |
| 7 | 7 |
| 8 | 8 |
| 9 #include "base/base_export.h" | 9 #include "base/base_export.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/time.h" | 11 #include "base/time.h" |
| 12 | 12 |
| 13 namespace tracked_objects { | 13 namespace tracked_objects { |
| 14 | 14 |
| 15 // TODO(isherman): Shouldn't this be explicitly an int32 or something like that? |
| 15 typedef int DurationInt; | 16 typedef int DurationInt; |
| 16 | 17 |
| 17 //------------------------------------------------------------------------------ | 18 //------------------------------------------------------------------------------ |
| 18 | 19 |
| 19 #define USE_FAST_TIME_CLASS_FOR_DURATION_CALCULATIONS | 20 #define USE_FAST_TIME_CLASS_FOR_DURATION_CALCULATIONS |
| 20 | 21 |
| 21 #if defined(USE_FAST_TIME_CLASS_FOR_DURATION_CALCULATIONS) | 22 #if defined(USE_FAST_TIME_CLASS_FOR_DURATION_CALCULATIONS) |
| 22 | 23 |
| 23 // TimeTicks maintains a wasteful 64 bits of data (we need less than 32), and on | 24 // TimeTicks maintains a wasteful 64 bits of data (we need less than 32), and on |
| 24 // windows, a 64 bit timer is expensive to even obtain. We use a simple | 25 // windows, a 64 bit timer is expensive to even obtain. We use a simple |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // with a more thoroughly tested class. | 80 // with a more thoroughly tested class. |
| 80 | 81 |
| 81 typedef base::TimeTicks TrackedTime; | 82 typedef base::TimeTicks TrackedTime; |
| 82 typedef base::TimeDelta Duration; | 83 typedef base::TimeDelta Duration; |
| 83 | 84 |
| 84 #endif // USE_FAST_TIME_CLASS_FOR_DURATION_CALCULATIONS | 85 #endif // USE_FAST_TIME_CLASS_FOR_DURATION_CALCULATIONS |
| 85 | 86 |
| 86 } // namespace tracked_objects | 87 } // namespace tracked_objects |
| 87 | 88 |
| 88 #endif // BASE_PROFILER_TRACKED_TIME_H_ | 89 #endif // BASE_PROFILER_TRACKED_TIME_H_ |
| OLD | NEW |