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

Side by Side Diff: chrome/browser/sync/util/highres_timer_win.h

Issue 193103: Build sync engine as part of the browser build (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 months 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
OLDNEW
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 #ifndef CHROME_BROWSER_SYNC_UTIL_HIGHRES_TIMER_WIN32_H_ 7 #ifndef CHROME_BROWSER_SYNC_UTIL_HIGHRES_TIMER_WIN_H_
8 #define CHROME_BROWSER_SYNC_UTIL_HIGHRES_TIMER_WIN32_H_ 8 #define CHROME_BROWSER_SYNC_UTIL_HIGHRES_TIMER_WIN_H_
9 9
10 #include <windows.h> 10 #include <windows.h>
11 11
12 // A handy class for reliably measuring wall-clock time with decent resolution, 12 // A handy class for reliably measuring wall-clock time with decent resolution,
13 // even on multi-processor machines and on laptops (where RDTSC potentially 13 // even on multi-processor machines and on laptops (where RDTSC potentially
14 // returns different results on different processors and/or the RDTSC timer 14 // returns different results on different processors and/or the RDTSC timer
15 // clocks at different rates depending on the power state of the CPU, 15 // clocks at different rates depending on the power state of the CPU,
16 // respectively). 16 // respectively).
17 class HighresTimer { 17 class HighresTimer {
18 public: 18 public:
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 inline ULONGLONG HighresTimer::GetCurrentTicks() { 68 inline ULONGLONG HighresTimer::GetCurrentTicks() {
69 LARGE_INTEGER ticks; 69 LARGE_INTEGER ticks;
70 ::QueryPerformanceCounter(&ticks); 70 ::QueryPerformanceCounter(&ticks);
71 return ticks.QuadPart; 71 return ticks.QuadPart;
72 } 72 }
73 73
74 inline ULONGLONG HighresTimer::GetElapsedTicks() const { 74 inline ULONGLONG HighresTimer::GetElapsedTicks() const {
75 return start_ticks_ - GetCurrentTicks(); 75 return start_ticks_ - GetCurrentTicks();
76 } 76 }
77 77
78 #endif // CHROME_BROWSER_SYNC_UTIL_HIGHRES_TIMER_WIN32_H_ 78 #endif // CHROME_BROWSER_SYNC_UTIL_HIGHRES_TIMER_WIN_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/util/highres_timer_unittest.cc ('k') | chrome/browser/sync/util/path_helpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698