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

Side by Side Diff: cc/debug/lap_timer.cc

Issue 864943002: Replaces instances of the deprecated TimeTicks::HighResNow() with TimeTicks::Now(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More changes based on review comments. Created 5 years, 11 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
« no previous file with comments | « base/time/time_win_unittest.cc ('k') | cc/debug/picture_record_benchmark.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "cc/debug/lap_timer.h" 5 #include "cc/debug/lap_timer.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace cc { 9 namespace cc {
10 10
11 namespace { 11 namespace {
12 12
13 base::TimeTicks Now() { 13 base::TimeTicks Now() {
14 return base::TimeTicks::IsThreadNowSupported() 14 return base::TimeTicks::IsThreadNowSupported() ? base::TimeTicks::ThreadNow()
15 ? base::TimeTicks::ThreadNow() 15 : base::TimeTicks::Now();
16 : base::TimeTicks::HighResNow();
17 } 16 }
18 17
19 } // namespace 18 } // namespace
20 19
21 LapTimer::LapTimer(int warmup_laps, 20 LapTimer::LapTimer(int warmup_laps,
22 base::TimeDelta time_limit, 21 base::TimeDelta time_limit,
23 int check_interval) 22 int check_interval)
24 : warmup_laps_(warmup_laps), 23 : warmup_laps_(warmup_laps),
25 remaining_warmups_(0), 24 remaining_warmups_(0),
26 remaining_no_check_laps_(0), 25 remaining_no_check_laps_(0),
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 } 71 }
73 72
74 float LapTimer::LapsPerSecond() { 73 float LapTimer::LapsPerSecond() {
75 DCHECK(HasTimedAllLaps()); 74 DCHECK(HasTimedAllLaps());
76 return num_laps_ / accumulator_.InSecondsF(); 75 return num_laps_ / accumulator_.InSecondsF();
77 } 76 }
78 77
79 int LapTimer::NumLaps() { return num_laps_; } 78 int LapTimer::NumLaps() { return num_laps_; }
80 79
81 } // namespace cc 80 } // namespace cc
OLDNEW
« no previous file with comments | « base/time/time_win_unittest.cc ('k') | cc/debug/picture_record_benchmark.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698