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

Unified Diff: base/highres_timer-win32.cc

Issue 624713003: Keep only base/extractor.[cc|h]. (Closed) Base URL: https://chromium.googlesource.com/external/omaha.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/highres_timer-win32.h ('k') | base/highres_timer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/highres_timer-win32.cc
diff --git a/base/highres_timer-win32.cc b/base/highres_timer-win32.cc
deleted file mode 100644
index f3d5111f149312a40126a9cc4215635a7bc2b825..0000000000000000000000000000000000000000
--- a/base/highres_timer-win32.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2006-2009 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// ========================================================================
-#include "omaha/base/highres_timer-win32.h"
-
-namespace omaha {
-
-bool HighresTimer::perf_freq_collected_ = false;
-ULONGLONG HighresTimer::perf_freq_ = 0;
-
-ULONGLONG HighresTimer::GetElapsedMs() const {
- ULONGLONG end_time = GetCurrentTicks();
-
- // Scale to ms and round to nearerst ms - rounding is important
- // because otherwise the truncation error may accumulate e.g. in sums.
- //
- // Given infinite resolution, this expression could be written as:
- // trunc((end - start (units:freq*sec))/freq (units:sec) *
- // 1000 (unit:ms) + 1/2 (unit:ms))
- ULONGLONG freq = GetTimerFrequency();
- return ((end_time - start_ticks_) * 1000L + freq / 2) / freq;
-}
-
-ULONGLONG HighresTimer::GetElapsedSec() const {
- ULONGLONG end_time = GetCurrentTicks();
-
- // Scale to ms and round to nearerst ms - rounding is important
- // because otherwise the truncation error may accumulate e.g. in sums.
- //
- // Given infinite resolution, this expression could be written as:
- // trunc((end - start (units:freq*sec))/freq (unit:sec) + 1/2 (unit:sec))
- ULONGLONG freq = GetTimerFrequency();
- return ((end_time - start_ticks_) + freq / 2) / freq;
-}
-
-void HighresTimer::CollectPerfFreq() {
- LARGE_INTEGER freq;
-
- // Note that this is racy.
- // It's OK, however, because even concurrent executions of this
- // are idempotent.
- if (::QueryPerformanceFrequency(&freq)) {
- perf_freq_ = freq.QuadPart;
- perf_freq_collected_ = true;
- }
-}
-
-} // namespace omaha
-
« no previous file with comments | « base/highres_timer-win32.h ('k') | base/highres_timer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698