Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: base/profiler/tracked_time.h

Issue 8502001: Switch to using an intergral type for durations inside profiler (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/tracked_objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 typedef int DurationInt;
16
15 //------------------------------------------------------------------------------ 17 //------------------------------------------------------------------------------
16 18
17 #define USE_FAST_TIME_CLASS_FOR_DURATION_CALCULATIONS 19 #define USE_FAST_TIME_CLASS_FOR_DURATION_CALCULATIONS
18 20
19 #if defined(USE_FAST_TIME_CLASS_FOR_DURATION_CALCULATIONS) 21 #if defined(USE_FAST_TIME_CLASS_FOR_DURATION_CALCULATIONS)
20 22
21 // TimeTicks maintains a wasteful 64 bits of data (we need less than 32), and on 23 // TimeTicks maintains a wasteful 64 bits of data (we need less than 32), and on
22 // windows, a 64 bit timer is expensive to even obtain. We use a simple 24 // windows, a 64 bit timer is expensive to even obtain. We use a simple
23 // millisecond counter for most of our time values, as well as millisecond units 25 // millisecond counter for most of our time values, as well as millisecond units
24 // of duration between those values. This means we can only handle durations 26 // of duration between those values. This means we can only handle durations
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 // with a more thoroughly tested class. 77 // with a more thoroughly tested class.
76 78
77 typedef base::TimeTicks TrackedTime; 79 typedef base::TimeTicks TrackedTime;
78 typedef base::TimeDelta Duration; 80 typedef base::TimeDelta Duration;
79 81
80 #endif // USE_FAST_TIME_CLASS_FOR_DURATION_CALCULATIONS 82 #endif // USE_FAST_TIME_CLASS_FOR_DURATION_CALCULATIONS
81 83
82 } // namespace tracked_objects 84 } // namespace tracked_objects
83 85
84 #endif // BASE_PROFILER_TRACKED_TIME_H_ 86 #endif // BASE_PROFILER_TRACKED_TIME_H_
OLDNEW
« no previous file with comments | « no previous file | base/tracked_objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698