OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/metrics/time_ticks_experiment_win.h" | 5 #include "chrome/browser/metrics/time_ticks_experiment_win.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 | 8 |
| 9 #include <windows.h> |
| 10 #include <algorithm> |
| 11 |
9 #include "base/cpu.h" | 12 #include "base/cpu.h" |
10 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
11 #include "base/win/windows_version.h" | 14 #include "base/win/windows_version.h" |
12 | 15 |
13 #include <windows.h> | |
14 | |
15 namespace chrome { | 16 namespace chrome { |
16 | 17 |
17 namespace { | 18 namespace { |
18 | 19 |
19 const int kNumIterations = 1000; | 20 const int kNumIterations = 1000; |
20 | 21 |
21 } // anonymous namespace | 22 } // anonymous namespace |
22 | 23 |
23 void CollectTimeTicksStats() { | 24 void CollectTimeTicksStats() { |
24 // This bit is supposed to indicate that rdtsc is safe across cores. If so, we | 25 // This bit is supposed to indicate that rdtsc is safe across cores. If so, we |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 bool success = min_delta_ns <= 10000; | 106 bool success = min_delta_ns <= 10000; |
106 if (success) { | 107 if (success) { |
107 UMA_HISTOGRAM_ENUMERATION("WinTimeTicks.VersionSuccessful", | 108 UMA_HISTOGRAM_ENUMERATION("WinTimeTicks.VersionSuccessful", |
108 info->version(), base::win::VERSION_WIN_LAST); | 109 info->version(), base::win::VERSION_WIN_LAST); |
109 } | 110 } |
110 } | 111 } |
111 | 112 |
112 } // namespace chrome | 113 } // namespace chrome |
113 | 114 |
114 #endif // defined(OS_WIN) | 115 #endif // defined(OS_WIN) |
OLD | NEW |