| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // High resolution timer functions for use in Windows. | 5 // High resolution timer functions for use in Windows. |
| 6 | 6 |
| 7 #include "chrome/browser/sync/util/highres_timer.h" | 7 #include "chrome/browser/sync/util/highres_timer.h" |
| 8 | 8 |
| 9 bool HighresTimer::perf_freq_collected_ = false; | 9 bool HighresTimer::perf_freq_collected_ = false; |
| 10 ULONGLONG HighresTimer::perf_freq_ = 0; | 10 ULONGLONG HighresTimer::perf_freq_ = 0; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 void HighresTimer::CollectPerfFreq() { | 37 void HighresTimer::CollectPerfFreq() { |
| 38 LARGE_INTEGER freq; | 38 LARGE_INTEGER freq; |
| 39 | 39 |
| 40 // Note that this is racy. It's OK, however, because even concurrent | 40 // Note that this is racy. It's OK, however, because even concurrent |
| 41 // executions of this are idempotent. | 41 // executions of this are idempotent. |
| 42 if (::QueryPerformanceFrequency(&freq)) { | 42 if (::QueryPerformanceFrequency(&freq)) { |
| 43 perf_freq_ = freq.QuadPart; | 43 perf_freq_ = freq.QuadPart; |
| 44 perf_freq_collected_ = true; | 44 perf_freq_collected_ = true; |
| 45 } | 45 } |
| 46 } | 46 } |
| OLD | NEW |