Replaces instances of the deprecated TimeTicks::HighResNow() with TimeTicks::Now().
BUG=
Review URL: https://codereview.chromium.org/864943002
Cr-Commit-Position: refs/heads/master@{#313084}
diff --git a/base/BUILD.gn b/base/BUILD.gn
index e20b744b..616e404 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -1172,7 +1172,6 @@
"debug/trace_event_synthetic_delay_unittest.cc",
"debug/trace_event_system_stats_monitor_unittest.cc",
"debug/trace_event_unittest.cc",
- "debug/trace_event_unittest.h",
"debug/trace_event_win_unittest.cc",
"deferred_sequenced_task_runner_unittest.cc",
"environment_unittest.cc",
diff --git a/base/base.gyp b/base/base.gyp
index 6b7d0da..c5b28c4 100644
--- a/base/base.gyp
+++ b/base/base.gyp
@@ -487,7 +487,6 @@
'debug/trace_event_synthetic_delay_unittest.cc',
'debug/trace_event_system_stats_monitor_unittest.cc',
'debug/trace_event_unittest.cc',
- 'debug/trace_event_unittest.h',
'debug/trace_event_win_unittest.cc',
'deferred_sequenced_task_runner_unittest.cc',
'environment_unittest.cc',
diff --git a/base/debug/trace_event_synthetic_delay.cc b/base/debug/trace_event_synthetic_delay.cc
index 6abfe18..260a5d8 100644
--- a/base/debug/trace_event_synthetic_delay.cc
+++ b/base/debug/trace_event_synthetic_delay.cc
@@ -184,7 +184,7 @@
}
base::TimeTicks TraceEventSyntheticDelayRegistry::Now() {
- return base::TimeTicks::HighResNow();
+ return base::TimeTicks::Now();
}
void TraceEventSyntheticDelayRegistry::ResetAllDelays() {
diff --git a/base/debug/trace_event_unittest.cc b/base/debug/trace_event_unittest.cc
index 30ad797..4494c99 100644
--- a/base/debug/trace_event_unittest.cc
+++ b/base/debug/trace_event_unittest.cc
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/debug/trace_event_unittest.h"
-
#include <math.h>
#include <cstdlib>
@@ -871,13 +869,6 @@
} // namespace
-void HighResSleepForTraceTest(base::TimeDelta elapsed) {
- base::TimeTicks end_time = base::TimeTicks::HighResNow() + elapsed;
- do {
- base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(1));
- } while (base::TimeTicks::HighResNow() < end_time);
-}
-
// Simple Test for emitting data and validating it was received.
TEST_F(TraceEventTestFixture, DataCaptured) {
TraceLog::GetInstance()->SetEnabled(
diff --git a/base/debug/trace_event_unittest.h b/base/debug/trace_event_unittest.h
deleted file mode 100644
index 599fec7..0000000
--- a/base/debug/trace_event_unittest.h
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/time/time.h"
-
-namespace base {
-namespace debug {
-
-// Sleep until HighResNow has advanced by at least |elapsed|.
-void HighResSleepForTraceTest(base::TimeDelta elapsed);
-
-} // namespace debug
-} // namespace base
diff --git a/base/message_loop/message_pump_perftest.cc b/base/message_loop/message_pump_perftest.cc
index 39ed5a8..b3e5604 100644
--- a/base/message_loop/message_pump_perftest.cc
+++ b/base/message_loop/message_pump_perftest.cc
@@ -29,7 +29,7 @@
void Increment(uint64_t amount) { counter_ += amount; }
void Schedule(int index) {
- base::TimeTicks start = base::TimeTicks::HighResNow();
+ base::TimeTicks start = base::TimeTicks::Now();
base::TimeTicks thread_start;
if (TimeTicks::IsThreadNowSupported())
thread_start = base::TimeTicks::ThreadNow();
@@ -42,7 +42,7 @@
target_message_loop()->ScheduleWork();
schedule_calls++;
}
- now = base::TimeTicks::HighResNow();
+ now = base::TimeTicks::Now();
base::TimeDelta laptime = now - lastnow;
lastnow = now;
minimum = std::min(minimum, laptime);
@@ -242,7 +242,7 @@
class PostTaskTest : public testing::Test {
public:
void Run(int batch_size, int tasks_per_reload) {
- base::TimeTicks start = base::TimeTicks::HighResNow();
+ base::TimeTicks start = base::TimeTicks::Now();
base::TimeTicks now;
MessageLoop loop(scoped_ptr<MessagePump>(new FakeMessagePump));
scoped_refptr<internal::IncomingTaskQueue> queue(
@@ -264,7 +264,7 @@
}
}
- now = base::TimeTicks::HighResNow();
+ now = base::TimeTicks::Now();
} while (now - start < base::TimeDelta::FromSeconds(5));
std::string trace = StringPrintf("%d_tasks_per_reload", tasks_per_reload);
perf_test::PrintResult(
diff --git a/base/rand_util_unittest.cc b/base/rand_util_unittest.cc
index d262275..90690ec2 100644
--- a/base/rand_util_unittest.cc
+++ b/base/rand_util_unittest.cc
@@ -134,10 +134,10 @@
const size_t kTestBufferSize = 1 * 1024 * 1024;
scoped_ptr<uint8[]> buffer(new uint8[kTestBufferSize]);
- const base::TimeTicks now = base::TimeTicks::HighResNow();
+ const base::TimeTicks now = base::TimeTicks::Now();
for (int i = 0; i < kTestIterations; ++i)
base::RandBytes(buffer.get(), kTestBufferSize);
- const base::TimeTicks end = base::TimeTicks::HighResNow();
+ const base::TimeTicks end = base::TimeTicks::Now();
LOG(INFO) << "RandBytes(" << kTestBufferSize << ") took: "
<< (end - now).InMicroseconds() << "µs";
diff --git a/base/test/trace_event_analyzer_unittest.cc b/base/test/trace_event_analyzer_unittest.cc
index 0edeb14..cc1f8a3c 100644
--- a/base/test/trace_event_analyzer_unittest.cc
+++ b/base/test/trace_event_analyzer_unittest.cc
@@ -3,9 +3,9 @@
// found in the LICENSE file.
#include "base/bind.h"
-#include "base/debug/trace_event_unittest.h"
#include "base/synchronization/waitable_event.h"
#include "base/test/trace_event_analyzer.h"
+#include "base/threading/platform_thread.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -409,7 +409,7 @@
TRACE_EVENT_BEGIN0("cat2", "name3"); // found by duration query
// next event not searched for, just noise
TRACE_EVENT_INSTANT0("noise", "name4", TRACE_EVENT_SCOPE_THREAD);
- base::debug::HighResSleepForTraceTest(kSleepTime);
+ base::PlatformThread::Sleep(kSleepTime);
TRACE_EVENT_BEGIN0("cat2", "name5"); // not found (duration too short)
TRACE_EVENT_END0("cat2", "name5"); // not found (duration too short)
TRACE_EVENT_END0("cat2", "name3"); // found by duration query
@@ -455,7 +455,7 @@
TRACE_EVENT0("cat2", "name3"); // found by duration query
// next event not searched for, just noise
TRACE_EVENT_INSTANT0("noise", "name4", TRACE_EVENT_SCOPE_THREAD);
- base::debug::HighResSleepForTraceTest(kSleepTime);
+ base::PlatformThread::Sleep(kSleepTime);
TRACE_EVENT0("cat2", "name5"); // not found (duration too short)
}
}
diff --git a/base/threading/thread_perftest.cc b/base/threading/thread_perftest.cc
index 9fbc844..b94f942 100644
--- a/base/threading/thread_perftest.cc
+++ b/base/threading/thread_perftest.cc
@@ -76,10 +76,10 @@
Init();
- base::TimeTicks start = base::TimeTicks::HighResNow();
+ base::TimeTicks start = base::TimeTicks::Now();
PingPong(kNumRuns);
done_.Wait();
- base::TimeTicks end = base::TimeTicks::HighResNow();
+ base::TimeTicks end = base::TimeTicks::Now();
// Gather the cpu-time spent on each thread. This does one extra tasks,
// but that should be in the noise given enough runs.
diff --git a/base/time/tick_clock.h b/base/time/tick_clock.h
index 3e53d83..2b8691fa 100644
--- a/base/time/tick_clock.h
+++ b/base/time/tick_clock.h
@@ -17,8 +17,8 @@
// See DefaultTickClock (base/time/default_tick_clock.h) for the default
// implementation that simply uses TimeTicks::Now().
//
-// (Other implementations that use TimeTicks::HighResNow() or
-// TimeTicks::NowFromSystemTime() should be added as needed.)
+// (Other implementations that use TimeTicks::NowFromSystemTime() should
+// be added as needed.)
//
// See SimpleTestTickClock (base/test/simple_test_tick_clock.h) for a
// simple test implementation.
diff --git a/base/time/time.h b/base/time/time.h
index 915eac8..eb86693 100644
--- a/base/time/time.h
+++ b/base/time/time.h
@@ -603,21 +603,12 @@
// microsecond.
static TimeTicks Now();
- // DEPRECATED
- // TODO(miu): Remove this function, and all callpoints should call Now().
- static TimeTicks HighResNow() { return TimeTicks::Now(); }
-
// Returns true if the high resolution clock is working on this system and
// Now() will return high resolution values. Note that, on systems where the
// high resolution clock works but is deemed inefficient, the low resolution
// clock will be used instead.
static bool IsHighResolution();
- // DEPRECATED
- // TODO(miu): Remove this function, and all callpoints should call
- // IsHighResolution().
- static bool IsHighResNowFastAndReliable() { return IsHighResolution(); }
-
// Returns true if ThreadNow() is supported on this system.
static bool IsThreadNowSupported() {
#if (defined(_POSIX_THREAD_CPUTIME) && (_POSIX_THREAD_CPUTIME >= 0)) || \
diff --git a/base/time/time_mac.cc b/base/time/time_mac.cc
index 3944d06..e263d079 100644
--- a/base/time/time_mac.cc
+++ b/base/time/time_mac.cc
@@ -230,7 +230,7 @@
// static
TimeTicks TimeTicks::NowFromSystemTraceTime() {
- return HighResNow();
+ return Now();
}
} // namespace base
diff --git a/base/time/time_posix.cc b/base/time/time_posix.cc
index 34b2f5ac..8b207eb 100644
--- a/base/time/time_posix.cc
+++ b/base/time/time_posix.cc
@@ -338,7 +338,7 @@
struct timespec ts;
if (clock_gettime(kClockSystemTrace, &ts) != 0) {
// NB: fall-back for a chrome os build running on linux
- return HighResNow();
+ return Now();
}
absolute_micro =
@@ -352,7 +352,7 @@
// static
TimeTicks TimeTicks::NowFromSystemTraceTime() {
- return HighResNow();
+ return Now();
}
#endif // defined(OS_CHROMEOS)
diff --git a/base/time/time_unittest.cc b/base/time/time_unittest.cc
index 07b1e6b..27f71b4 100644
--- a/base/time/time_unittest.cc
+++ b/base/time/time_unittest.cc
@@ -643,8 +643,8 @@
}
static void HighResClockTest(TimeTicks (*GetTicks)()) {
- // HighResNow doesn't work on some systems. Since the product still works
- // even if it doesn't work, it makes this entire test questionable.
+ // IsHighResolution() is false on some systems. Since the product still works
+ // even if it's false, it makes this entire test questionable.
if (!TimeTicks::IsHighResolution())
return;
@@ -679,8 +679,8 @@
EXPECT_TRUE(success);
}
-TEST(TimeTicks, HighResNow) {
- HighResClockTest(&TimeTicks::HighResNow);
+TEST(TimeTicks, HighRes) {
+ HighResClockTest(&TimeTicks::Now);
}
// Fails frequently on Android http://crbug.com/352633 with:
@@ -711,7 +711,7 @@
}
TEST(TimeTicks, NowFromSystemTraceTime) {
- // Re-use HighResNow test for now since clock properties are identical.
+ // Re-use HighRes test for now since clock properties are identical.
HighResClockTest(&TimeTicks::NowFromSystemTraceTime);
}
diff --git a/base/time/time_win_unittest.cc b/base/time/time_win_unittest.cc
index 71cd29e..82be8c5 100644
--- a/base/time/time_win_unittest.cc
+++ b/base/time/time_win_unittest.cc
@@ -116,8 +116,8 @@
}
TEST(TimeTicks, SubMillisecondTimers) {
- // HighResNow doesn't work on some systems. Since the product still works
- // even if it doesn't work, it makes this entire test questionable.
+ // IsHighResolution() is false on some systems. Since the product still works
+ // even if it's false, it makes this entire test questionable.
if (!TimeTicks::IsHighResolution())
return;
@@ -126,11 +126,11 @@
// Run kRetries attempts to see a sub-millisecond timer.
for (int index = 0; index < kRetries; index++) {
- TimeTicks last_time = TimeTicks::HighResNow();
+ TimeTicks last_time = TimeTicks::Now();
TimeDelta delta;
// Spin until the clock has detected a change.
do {
- delta = TimeTicks::HighResNow() - last_time;
+ delta = TimeTicks::Now() - last_time;
} while (delta.InMicroseconds() == 0);
if (delta.InMicroseconds() < 1000) {
saw_submillisecond_timer = true;
@@ -193,10 +193,10 @@
int test_case = 0;
while (cases[test_case].func) {
- TimeTicks start = TimeTicks::HighResNow();
+ TimeTicks start = TimeTicks::Now();
for (int index = 0; index < kLoops; index++)
cases[test_case].func();
- TimeTicks stop = TimeTicks::HighResNow();
+ TimeTicks stop = TimeTicks::Now();
// Turning off the check for acceptible delays. Without this check,
// the test really doesn't do much other than measure. But the
// measurements are still useful for testing timers on various platforms.
diff --git a/cc/debug/lap_timer.cc b/cc/debug/lap_timer.cc
index 27aaf34..10d26f94 100644
--- a/cc/debug/lap_timer.cc
+++ b/cc/debug/lap_timer.cc
@@ -11,9 +11,8 @@
namespace {
base::TimeTicks Now() {
- return base::TimeTicks::IsThreadNowSupported()
- ? base::TimeTicks::ThreadNow()
- : base::TimeTicks::HighResNow();
+ return base::TimeTicks::IsThreadNowSupported() ? base::TimeTicks::ThreadNow()
+ : base::TimeTicks::Now();
}
} // namespace
diff --git a/cc/debug/picture_record_benchmark.cc b/cc/debug/picture_record_benchmark.cc
index cc01448f..d0d031d 100644
--- a/cc/debug/picture_record_benchmark.cc
+++ b/cc/debug/picture_record_benchmark.cc
@@ -104,12 +104,12 @@
for (int x = 0; x < x_limit; x += kPositionIncrement) {
gfx::Rect rect = gfx::Rect(x, y, width, height);
- base::TimeTicks start = base::TimeTicks::HighResNow();
+ base::TimeTicks start = base::TimeTicks::Now();
scoped_refptr<Picture> picture = Picture::Create(
rect, painter, tile_grid_size, false, Picture::RECORD_NORMALLY);
- base::TimeTicks end = base::TimeTicks::HighResNow();
+ base::TimeTicks end = base::TimeTicks::Now();
base::TimeDelta duration = end - start;
TotalTime& total_time = times_[dimensions];
total_time.first += duration;
diff --git a/cc/debug/rendering_stats_instrumentation.cc b/cc/debug/rendering_stats_instrumentation.cc
index c707e23..4a28a66 100644
--- a/cc/debug/rendering_stats_instrumentation.cc
+++ b/cc/debug/rendering_stats_instrumentation.cc
@@ -41,7 +41,7 @@
if (record_rendering_stats_) {
if (base::TimeTicks::IsThreadNowSupported())
return base::TimeTicks::ThreadNow();
- return base::TimeTicks::HighResNow();
+ return base::TimeTicks::Now();
}
return base::TimeTicks();
}
@@ -51,7 +51,7 @@
if (!start_time.is_null()) {
if (base::TimeTicks::IsThreadNowSupported())
return base::TimeTicks::ThreadNow() - start_time;
- return base::TimeTicks::HighResNow() - start_time;
+ return base::TimeTicks::Now() - start_time;
}
return base::TimeDelta();
}
diff --git a/cc/scheduler/delay_based_time_source.cc b/cc/scheduler/delay_based_time_source.cc
index cd214fd..dbfdc0d 100644
--- a/cc/scheduler/delay_based_time_source.cc
+++ b/cc/scheduler/delay_based_time_source.cc
@@ -36,7 +36,7 @@
} // namespace
// The following methods correspond to the DelayBasedTimeSource that uses
-// the base::TimeTicks::HighResNow as the timebase.
+// the base::TimeTicks::Now as the timebase.
scoped_refptr<DelayBasedTimeSourceHighRes> DelayBasedTimeSourceHighRes::Create(
base::TimeDelta interval,
base::SingleThreadTaskRunner* task_runner) {
@@ -53,7 +53,7 @@
DelayBasedTimeSourceHighRes::~DelayBasedTimeSourceHighRes() {}
base::TimeTicks DelayBasedTimeSourceHighRes::Now() const {
- return base::TimeTicks::HighResNow();
+ return base::TimeTicks::Now();
}
// The following methods correspond to the DelayBasedTimeSource that uses
diff --git a/cc/scheduler/delay_based_time_source.h b/cc/scheduler/delay_based_time_source.h
index 9f670d1..ea03f9d 100644
--- a/cc/scheduler/delay_based_time_source.h
+++ b/cc/scheduler/delay_based_time_source.h
@@ -95,7 +95,9 @@
DISALLOW_COPY_AND_ASSIGN(DelayBasedTimeSource);
};
-// DelayBasedTimeSource uses base::TimeTicks::HighResNow as its timebase.
+// DelayBasedTimeSource that once used base::TimeTicks::HighResNow as its time
+// source, but is now a no-op.
+// TODO(brianderson): Remove along with gfx::/FrameTime.http://crbug.com/447329
class DelayBasedTimeSourceHighRes : public DelayBasedTimeSource {
public:
static scoped_refptr<DelayBasedTimeSourceHighRes> Create(
diff --git a/cc/trees/proxy_timing_history.cc b/cc/trees/proxy_timing_history.cc
index 9020ad5..90abad1 100644
--- a/cc/trees/proxy_timing_history.cc
+++ b/cc/trees/proxy_timing_history.cc
@@ -43,11 +43,11 @@
}
void ProxyTimingHistory::DidBeginMainFrame() {
- begin_main_frame_sent_time_ = base::TimeTicks::HighResNow();
+ begin_main_frame_sent_time_ = base::TimeTicks::Now();
}
void ProxyTimingHistory::DidCommit() {
- commit_complete_time_ = base::TimeTicks::HighResNow();
+ commit_complete_time_ = base::TimeTicks::Now();
base::TimeDelta begin_main_frame_to_commit_duration =
commit_complete_time_ - begin_main_frame_sent_time_;
@@ -64,7 +64,7 @@
void ProxyTimingHistory::DidActivateSyncTree() {
base::TimeDelta commit_to_activate_duration =
- base::TimeTicks::HighResNow() - commit_complete_time_;
+ base::TimeTicks::Now() - commit_complete_time_;
// Before adding the new data point to the timing history, see what we would
// have predicted for this frame. This allows us to keep track of the accuracy
@@ -77,12 +77,11 @@
}
void ProxyTimingHistory::DidStartDrawing() {
- start_draw_time_ = base::TimeTicks::HighResNow();
+ start_draw_time_ = base::TimeTicks::Now();
}
void ProxyTimingHistory::DidFinishDrawing() {
- base::TimeDelta draw_duration =
- base::TimeTicks::HighResNow() - start_draw_time_;
+ base::TimeDelta draw_duration = base::TimeTicks::Now() - start_draw_time_;
// Before adding the new data point to the timing history, see what we would
// have predicted for this frame. This allows us to keep track of the accuracy
diff --git a/chrome/browser/load_library_perf_test.cc b/chrome/browser/load_library_perf_test.cc
index ec48311..7f400b4 100644
--- a/chrome/browser/load_library_perf_test.cc
+++ b/chrome/browser/load_library_perf_test.cc
@@ -29,10 +29,10 @@
true);
base::NativeLibraryLoadError error;
- base::TimeTicks start = base::TimeTicks::HighResNow();
+ base::TimeTicks start = base::TimeTicks::Now();
base::NativeLibrary native_library =
base::LoadNativeLibrary(library_path, &error);
- double delta = (base::TimeTicks::HighResNow() - start).InMillisecondsF();
+ double delta = (base::TimeTicks::Now() - start).InMillisecondsF();
ASSERT_TRUE(native_library) << "Error loading library: " << error.ToString();
base::UnloadNativeLibrary(native_library);
perf_test::PrintResult("time_to_load_library",
diff --git a/chrome/browser/net/network_stats.cc b/chrome/browser/net/network_stats.cc
index 388f5c6..51df4c2 100644
--- a/chrome/browser/net/network_stats.cc
+++ b/chrome/browser/net/network_stats.cc
@@ -417,8 +417,6 @@
TestType test_type = test_sequence_[current_test_index_];
uint32 received_packets = packets_received_mask_.count();
- // Now() has resolution ~1-15ms. HighResNow() has high resolution but it
- // is warned not to use it unless necessary.
base::TimeTicks current_time = base::TimeTicks::Now();
last_arrival_time_ = current_time;
if (first_arrival_time_.is_null())
diff --git a/chrome/renderer/benchmarking_extension.cc b/chrome/renderer/benchmarking_extension.cc
index 555de01..1a47051 100644
--- a/chrome/renderer/benchmarking_extension.cc
+++ b/chrome/renderer/benchmarking_extension.cc
@@ -119,7 +119,7 @@
static void HiResTime(const v8::FunctionCallbackInfo<v8::Value>& args) {
args.GetReturnValue().Set(
- static_cast<double>(base::TimeTicks::HighResNow().ToInternalValue()));
+ static_cast<double>(base::TimeTicks::Now().ToInternalValue()));
}
};
diff --git a/content/browser/renderer_host/p2p/socket_host.cc b/content/browser/renderer_host/p2p/socket_host.cc
index 6358eff..bc54d400 100644
--- a/content/browser/renderer_host/p2p/socket_host.cc
+++ b/content/browser/renderer_host/p2p/socket_host.cc
@@ -141,12 +141,11 @@
return;
}
- // Now() has resolution ~1-15ms, using HighResNow(). But it is warned not to
- // use it unless necessary, as it is expensive than Now().
+ // Now() has resolution ~1-15ms
uint32 now_second = abs_send_time;
if (!now_second) {
uint64 now_us =
- (base::TimeTicks::HighResNow() - base::TimeTicks()).InMicroseconds();
+ (base::TimeTicks::Now() - base::TimeTicks()).InMicroseconds();
// Convert second to 24-bit unsigned with 18 bit fractional part
now_second =
((now_us << 18) / base::Time::kMicrosecondsPerSecond) & 0x00FFFFFF;
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
index a6debc3..99f2aa3 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -403,9 +403,6 @@
bool GotResponseToLockMouseRequest(bool allowed);
// Tells the RenderWidget about the latest vsync parameters.
- // Note: Make sure the timebase was obtained using
- // base::TimeTicks::HighResNow. Using the non-high res timer will result in
- // incorrect synchronization across processes.
virtual void UpdateVSyncParameters(base::TimeTicks timebase,
base::TimeDelta interval);
diff --git a/content/common/cc_messages_perftest.cc b/content/common/cc_messages_perftest.cc
index 1aa09e8..78085d2 100644
--- a/content/common/cc_messages_perftest.cc
+++ b/content/common/cc_messages_perftest.cc
@@ -33,7 +33,7 @@
IPC::ParamTraits<CompositorFrame>::Write(&msg, frame);
}
- base::TimeTicks start = base::TimeTicks::HighResNow();
+ base::TimeTicks start = base::TimeTicks::Now();
base::TimeTicks end =
start + base::TimeDelta::FromMilliseconds(kTimeLimitMillis);
base::TimeDelta min_time;
@@ -45,10 +45,10 @@
++count;
}
- base::TimeTicks now = base::TimeTicks::HighResNow();
+ base::TimeTicks now = base::TimeTicks::Now();
if (now - start < min_time || min_time == base::TimeDelta())
min_time = now - start;
- start = base::TimeTicks::HighResNow();
+ start = base::TimeTicks::Now();
}
perf_test::PrintResult(
diff --git a/content/renderer/input/input_handler_proxy.cc b/content/renderer/input/input_handler_proxy.cc
index c62d489..edb8e17 100644
--- a/content/renderer/input/input_handler_proxy.cc
+++ b/content/renderer/input/input_handler_proxy.cc
@@ -132,7 +132,7 @@
if (it == latency_info.latency_components.end())
return;
- base::TimeDelta delta = base::TimeTicks::HighResNow() - it->second.event_time;
+ base::TimeDelta delta = base::TimeTicks::Now() - it->second.event_time;
for (size_t i = 0; i < it->second.event_count; ++i) {
switch (event.type) {
case blink::WebInputEvent::GestureScrollBegin:
@@ -186,8 +186,7 @@
disallow_horizontal_fling_scroll_(false),
disallow_vertical_fling_scroll_(false),
has_fling_animation_started_(false),
- uma_latency_reporting_enabled_(
- base::TimeTicks::IsHighResNowFastAndReliable()) {
+ uma_latency_reporting_enabled_(base::TimeTicks::IsHighResolution()) {
DCHECK(client);
input_handler_->BindToClient(this);
smooth_scroll_enabled_ = base::CommandLine::ForCurrentProcess()->HasSwitch(
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index d737bfd..03acfec0 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -1102,8 +1102,8 @@
&latency_info);
base::TimeTicks start_time;
- if (base::TimeTicks::IsHighResNowFastAndReliable())
- start_time = base::TimeTicks::HighResNow();
+ if (base::TimeTicks::IsHighResolution())
+ start_time = base::TimeTicks::Now();
TRACE_EVENT1("renderer", "RenderWidget::OnHandleInputEvent",
"event", WebInputEventTraits::GetName(input_event->type));
@@ -1207,13 +1207,13 @@
bool frame_pending = compositor_ && compositor_->BeginMainFrameRequested();
- // If we don't have a fast and accurate HighResNow, we assume the input
- // handlers are heavy and rate limit them.
+ // If we don't have a fast and accurate Now(), we assume the input handlers
+ // are heavy and rate limit them.
bool rate_limiting_wanted =
input_event->type == WebInputEvent::MouseMove ||
input_event->type == WebInputEvent::MouseWheel;
if (rate_limiting_wanted && !start_time.is_null()) {
- base::TimeTicks end_time = base::TimeTicks::HighResNow();
+ base::TimeTicks end_time = base::TimeTicks::Now();
total_input_handling_time_this_frame_ += (end_time - start_time);
rate_limiting_wanted =
total_input_handling_time_this_frame_.InMicroseconds() >
diff --git a/content/renderer/skia_benchmarking_extension.cc b/content/renderer/skia_benchmarking_extension.cc
index 8cf6edd..dccf88d 100644
--- a/content/renderer/skia_benchmarking_extension.cc
+++ b/content/renderer/skia_benchmarking_extension.cc
@@ -263,9 +263,9 @@
bitmap.allocN32Pixels(bounds.width(), bounds.height());
SkCanvas bitmap_canvas(bitmap);
bitmap_canvas.clear(SK_ColorTRANSPARENT);
- base::TimeTicks t0 = base::TimeTicks::HighResNow();
+ base::TimeTicks t0 = base::TimeTicks::Now();
picture->Replay(&bitmap_canvas);
- base::TimeDelta total_time = base::TimeTicks::HighResNow() - t0;
+ base::TimeDelta total_time = base::TimeTicks::Now() - t0;
// Gather per-op timing info by drawing into a BenchmarkingCanvas.
skia::BenchmarkingCanvas benchmarking_canvas(bounds.width(), bounds.height());
diff --git a/gpu/command_buffer/common/time.h b/gpu/command_buffer/common/time.h
index e4eb942..e58145b 100644
--- a/gpu/command_buffer/common/time.h
+++ b/gpu/command_buffer/common/time.h
@@ -12,7 +12,7 @@
namespace gpu {
inline uint64 MicrosecondsSinceOriginOfTime() {
- return (base::TimeTicks::HighResNow() - base::TimeTicks()).InMicroseconds();
+ return (base::TimeTicks::Now() - base::TimeTicks()).InMicroseconds();
}
} // namespace gpu
diff --git a/gpu/command_buffer/service/async_pixel_transfer_manager_egl.cc b/gpu/command_buffer/service/async_pixel_transfer_manager_egl.cc
index 34e3a37..4b87938 100644
--- a/gpu/command_buffer/service/async_pixel_transfer_manager_egl.cc
+++ b/gpu/command_buffer/service/async_pixel_transfer_manager_egl.cc
@@ -256,7 +256,7 @@
base::TimeTicks begin_time;
if (texture_upload_stats.get())
- begin_time = base::TimeTicks::HighResNow();
+ begin_time = base::TimeTicks::Now();
{
TRACE_EVENT0("gpu", "glTexImage2D no data");
@@ -291,8 +291,7 @@
DCHECK(CHECK_GL());
if (texture_upload_stats.get()) {
- texture_upload_stats->AddUpload(base::TimeTicks::HighResNow() -
- begin_time);
+ texture_upload_stats->AddUpload(base::TimeTicks::Now() - begin_time);
}
}
@@ -314,7 +313,7 @@
base::TimeTicks begin_time;
if (texture_upload_stats.get())
- begin_time = base::TimeTicks::HighResNow();
+ begin_time = base::TimeTicks::Now();
if (!thread_texture_id_) {
TRACE_EVENT0("gpu", "glEGLImageTargetTexture2DOES");
@@ -335,8 +334,7 @@
DCHECK(CHECK_GL());
if (texture_upload_stats.get()) {
- texture_upload_stats->AddUpload(base::TimeTicks::HighResNow() -
- begin_time);
+ texture_upload_stats->AddUpload(base::TimeTicks::Now() - begin_time);
}
}
@@ -641,7 +639,7 @@
void* data = mem_params.GetDataAddress();
base::TimeTicks begin_time;
if (shared_state_->texture_upload_stats.get())
- begin_time = base::TimeTicks::HighResNow();
+ begin_time = base::TimeTicks::Now();
{
TRACE_EVENT0("gpu", "glTexSubImage2D");
// Note we use define_params_ instead of tex_params.
@@ -650,7 +648,7 @@
}
if (shared_state_->texture_upload_stats.get()) {
shared_state_->texture_upload_stats
- ->AddUpload(base::TimeTicks::HighResNow() - begin_time);
+ ->AddUpload(base::TimeTicks::Now() - begin_time);
}
DCHECK(CHECK_GL());
diff --git a/gpu/command_buffer/service/async_pixel_transfer_manager_idle.cc b/gpu/command_buffer/service/async_pixel_transfer_manager_idle.cc
index 61db3b68..de92c0c 100644
--- a/gpu/command_buffer/service/async_pixel_transfer_manager_idle.cc
+++ b/gpu/command_buffer/service/async_pixel_transfer_manager_idle.cc
@@ -144,7 +144,7 @@
void* data = mem_params.GetDataAddress();
- base::TimeTicks begin_time(base::TimeTicks::HighResNow());
+ base::TimeTicks begin_time(base::TimeTicks::Now());
gfx::ScopedTextureBinder texture_binder(tex_params.target, texture_id_);
{
@@ -165,7 +165,7 @@
transfer_in_progress_ = false;
shared_state_->texture_upload_count++;
shared_state_->total_texture_upload_time +=
- base::TimeTicks::HighResNow() - begin_time;
+ base::TimeTicks::Now() - begin_time;
// The texture is already fully bound so just call it now.
bind_callback.Run();
@@ -180,7 +180,7 @@
void* data = mem_params.GetDataAddress();
- base::TimeTicks begin_time(base::TimeTicks::HighResNow());
+ base::TimeTicks begin_time(base::TimeTicks::Now());
gfx::ScopedTextureBinder texture_binder(tex_params.target, texture_id_);
// If it's a full texture update, use glTexImage2D as it's faster.
@@ -220,7 +220,7 @@
transfer_in_progress_ = false;
shared_state_->texture_upload_count++;
shared_state_->total_texture_upload_time +=
- base::TimeTicks::HighResNow() - begin_time;
+ base::TimeTicks::Now() - begin_time;
}
AsyncPixelTransferManagerIdle::Task::Task(
diff --git a/gpu/command_buffer/service/async_pixel_transfer_manager_share_group.cc b/gpu/command_buffer/service/async_pixel_transfer_manager_share_group.cc
index b6506bfb..4f85e33 100644
--- a/gpu/command_buffer/service/async_pixel_transfer_manager_share_group.cc
+++ b/gpu/command_buffer/service/async_pixel_transfer_manager_share_group.cc
@@ -293,7 +293,7 @@
base::TimeTicks begin_time;
if (texture_upload_stats.get())
- begin_time = base::TimeTicks::HighResNow();
+ begin_time = base::TimeTicks::Now();
void* data = mem_params.GetDataAddress();
@@ -312,8 +312,7 @@
}
if (texture_upload_stats.get()) {
- texture_upload_stats->AddUpload(base::TimeTicks::HighResNow() -
- begin_time);
+ texture_upload_stats->AddUpload(base::TimeTicks::Now() - begin_time);
}
}
@@ -331,7 +330,7 @@
base::TimeTicks begin_time;
if (texture_upload_stats.get())
- begin_time = base::TimeTicks::HighResNow();
+ begin_time = base::TimeTicks::Now();
void* data = mem_params.GetDataAddress();
{
@@ -349,8 +348,7 @@
}
if (texture_upload_stats.get()) {
- texture_upload_stats->AddUpload(base::TimeTicks::HighResNow() -
- begin_time);
+ texture_upload_stats->AddUpload(base::TimeTicks::Now() - begin_time);
}
}
diff --git a/gpu/command_buffer/service/async_pixel_transfer_manager_sync.cc b/gpu/command_buffer/service/async_pixel_transfer_manager_sync.cc
index 4bc2ba2..589598b 100644
--- a/gpu/command_buffer/service/async_pixel_transfer_manager_sync.cc
+++ b/gpu/command_buffer/service/async_pixel_transfer_manager_sync.cc
@@ -45,7 +45,7 @@
// Save the define params to return later during deferred
// binding of the transfer texture.
void* data = mem_params.GetDataAddress();
- base::TimeTicks begin_time(base::TimeTicks::HighResNow());
+ base::TimeTicks begin_time(base::TimeTicks::Now());
glTexImage2D(
tex_params.target,
tex_params.level,
@@ -58,7 +58,7 @@
data);
shared_state_->texture_upload_count++;
shared_state_->total_texture_upload_time +=
- base::TimeTicks::HighResNow() - begin_time;
+ base::TimeTicks::Now() - begin_time;
// The texture is already fully bound so just call it now.
bind_callback.Run();
}
@@ -67,7 +67,7 @@
const AsyncTexSubImage2DParams& tex_params,
const AsyncMemoryParams& mem_params) {
void* data = mem_params.GetDataAddress();
- base::TimeTicks begin_time(base::TimeTicks::HighResNow());
+ base::TimeTicks begin_time(base::TimeTicks::Now());
glTexSubImage2D(
tex_params.target,
tex_params.level,
@@ -80,7 +80,7 @@
data);
shared_state_->texture_upload_count++;
shared_state_->total_texture_upload_time +=
- base::TimeTicks::HighResNow() - begin_time;
+ base::TimeTicks::Now() - begin_time;
}
bool AsyncPixelTransferDelegateSync::TransferIsInProgress() {
diff --git a/gpu/command_buffer/service/gpu_scheduler.cc b/gpu/command_buffer/service/gpu_scheduler.cc
index 3f8f1bf..93cf89f0 100644
--- a/gpu/command_buffer/service/gpu_scheduler.cc
+++ b/gpu/command_buffer/service/gpu_scheduler.cc
@@ -61,7 +61,7 @@
if (!IsScheduled())
return;
- base::TimeTicks begin_time(base::TimeTicks::HighResNow());
+ base::TimeTicks begin_time(base::TimeTicks::Now());
error::Error error = error::kNoError;
if (decoder_)
decoder_->BeginDecoding();
@@ -102,8 +102,7 @@
command_buffer_->SetParseError(error::kLostContext);
}
decoder_->EndDecoding();
- decoder_->AddProcessingCommandsTime(
- base::TimeTicks::HighResNow() - begin_time);
+ decoder_->AddProcessingCommandsTime(base::TimeTicks::Now() - begin_time);
}
}
diff --git a/gpu/command_buffer/service/program_manager.cc b/gpu/command_buffer/service/program_manager.cc
index 634fbc0..d7763508 100644
--- a/gpu/command_buffer/service/program_manager.cc
+++ b/gpu/command_buffer/service/program_manager.cc
@@ -553,7 +553,7 @@
return false;
}
- TimeTicks before_time = TimeTicks::HighResNow();
+ TimeTicks before_time = TimeTicks::Now();
bool link = true;
ProgramCache* cache = manager_->program_cache_;
if (cache) {
@@ -582,7 +582,7 @@
if (link) {
ExecuteBindAttribLocationCalls();
- before_time = TimeTicks::HighResNow();
+ before_time = TimeTicks::Now();
if (cache && gfx::g_driver_gl.ext.b_GL_ARB_get_program_binary) {
glProgramParameteri(service_id(),
PROGRAM_BINARY_RETRIEVABLE_HINT,
@@ -608,7 +608,7 @@
UMA_HISTOGRAM_CUSTOM_COUNTS(
"GPU.ProgramCache.BinaryCacheMissTime",
static_cast<base::HistogramBase::Sample>(
- (TimeTicks::HighResNow() - before_time).InMicroseconds()),
+ (TimeTicks::Now() - before_time).InMicroseconds()),
0,
static_cast<base::HistogramBase::Sample>(
TimeDelta::FromSeconds(10).InMicroseconds()),
@@ -617,7 +617,7 @@
UMA_HISTOGRAM_CUSTOM_COUNTS(
"GPU.ProgramCache.BinaryCacheHitTime",
static_cast<base::HistogramBase::Sample>(
- (TimeTicks::HighResNow() - before_time).InMicroseconds()),
+ (TimeTicks::Now() - before_time).InMicroseconds()),
0,
static_cast<base::HistogramBase::Sample>(
TimeDelta::FromSeconds(1).InMicroseconds()),
diff --git a/gpu/command_buffer/service/query_manager.cc b/gpu/command_buffer/service/query_manager.cc
index 8b753337..c0808c4 100644
--- a/gpu/command_buffer/service/query_manager.cc
+++ b/gpu/command_buffer/service/query_manager.cc
@@ -216,12 +216,12 @@
}
bool CommandsIssuedQuery::Begin() {
- begin_time_ = base::TimeTicks::HighResNow();
+ begin_time_ = base::TimeTicks::Now();
return true;
}
bool CommandsIssuedQuery::End(base::subtle::Atomic32 submit_count) {
- base::TimeDelta elapsed = base::TimeTicks::HighResNow() - begin_time_;
+ base::TimeDelta elapsed = base::TimeTicks::Now() - begin_time_;
MarkAsPending(submit_count);
return MarkAsCompleted(elapsed.InMicroseconds());
}
@@ -264,7 +264,7 @@
}
bool CommandLatencyQuery::End(base::subtle::Atomic32 submit_count) {
- base::TimeDelta now = base::TimeTicks::HighResNow() - base::TimeTicks();
+ base::TimeDelta now = base::TimeTicks::Now() - base::TimeTicks();
MarkAsPending(submit_count);
return MarkAsCompleted(now.InMicroseconds());
}
@@ -418,7 +418,7 @@
: Query(manager, target, shm_id, shm_offset) {}
bool CommandsCompletedQuery::Begin() {
- begin_time_ = base::TimeTicks::HighResNow();
+ begin_time_ = base::TimeTicks::Now();
return true;
}
@@ -435,7 +435,7 @@
if (!did_finish && fence_ && !fence_->HasCompleted())
return true;
- base::TimeDelta elapsed = base::TimeTicks::HighResNow() - begin_time_;
+ base::TimeDelta elapsed = base::TimeTicks::Now() - begin_time_;
return MarkAsCompleted(elapsed.InMicroseconds());
}
diff --git a/gpu/command_buffer/service/texture_manager.cc b/gpu/command_buffer/service/texture_manager.cc
index b914f6dde..b066e8d1 100644
--- a/gpu/command_buffer/service/texture_manager.cc
+++ b/gpu/command_buffer/service/texture_manager.cc
@@ -1718,13 +1718,13 @@
ScopedTextureUploadTimer::ScopedTextureUploadTimer(
DecoderTextureState* texture_state)
: texture_state_(texture_state),
- begin_time_(base::TimeTicks::HighResNow()) {
+ begin_time_(base::TimeTicks::Now()) {
}
ScopedTextureUploadTimer::~ScopedTextureUploadTimer() {
texture_state_->texture_upload_count++;
texture_state_->total_texture_upload_time +=
- base::TimeTicks::HighResNow() - begin_time_;
+ base::TimeTicks::Now() - begin_time_;
}
} // namespace gles2
diff --git a/gpu/command_buffer/tests/gl_query_unittest.cc b/gpu/command_buffer/tests/gl_query_unittest.cc
index 5ea7e8d..b12adc3 100644
--- a/gpu/command_buffer/tests/gl_query_unittest.cc
+++ b/gpu/command_buffer/tests/gl_query_unittest.cc
@@ -36,7 +36,7 @@
GLuint available;
GLuint result;
- base::TimeTicks before = base::TimeTicks::HighResNow();
+ base::TimeTicks before = base::TimeTicks::Now();
// Begin two queries of different types
glBeginQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM, commands_issue_query);
@@ -50,7 +50,7 @@
glFinish();
- base::TimeTicks after = base::TimeTicks::HighResNow();
+ base::TimeTicks after = base::TimeTicks::Now();
// Check that we got result on both queries.
@@ -152,7 +152,7 @@
return;
}
- base::TimeTicks before = base::TimeTicks::HighResNow();
+ base::TimeTicks before = base::TimeTicks::Now();
GLuint query;
glGenQueriesEXT(1, &query);
@@ -164,7 +164,7 @@
GLuint result = 0;
glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_EXT, &result);
- base::TimeTicks after = base::TimeTicks::HighResNow();
+ base::TimeTicks after = base::TimeTicks::Now();
// Sanity check - the resulting delta is shorter than the time it took to
// run this test.
EXPECT_LE(result, base::TimeDelta(after - before).InMicroseconds());
@@ -194,5 +194,3 @@
}
} // namespace gpu
-
-
diff --git a/jingle/glue/pseudotcp_adapter_unittest.cc b/jingle/glue/pseudotcp_adapter_unittest.cc
index ef031a9..212a2d0 100644
--- a/jingle/glue/pseudotcp_adapter_unittest.cc
+++ b/jingle/glue/pseudotcp_adapter_unittest.cc
@@ -46,13 +46,13 @@
: volume_(volume),
rate_(rate),
level_(0.0),
- last_update_(base::TimeTicks::HighResNow()) {
+ last_update_(base::TimeTicks::Now()) {
}
~LeakyBucket() override {}
bool DropNextPacket() override {
- base::TimeTicks now = base::TimeTicks::HighResNow();
+ base::TimeTicks now = base::TimeTicks::Now();
double interval = (now - last_update_).InSecondsF();
last_update_ = now;
level_ = level_ + 1.0 - interval * rate_;
diff --git a/media/audio/clockless_audio_sink.cc b/media/audio/clockless_audio_sink.cc
index 88e25b8af8..77f70571 100644
--- a/media/audio/clockless_audio_sink.cc
+++ b/media/audio/clockless_audio_sink.cc
@@ -44,10 +44,10 @@
base::PlatformThread::YieldCurrentThread();
} else if (start.is_null()) {
// First time we processed some audio, so record the starting time.
- start = base::TimeTicks::HighResNow();
+ start = base::TimeTicks::Now();
} else {
// Keep track of the last time data was rendered.
- playback_time_ = base::TimeTicks::HighResNow() - start;
+ playback_time_ = base::TimeTicks::Now() - start;
}
}
}
diff --git a/media/base/audio_bus_perftest.cc b/media/base/audio_bus_perftest.cc
index 0af0235..71e8132 100644
--- a/media/base/audio_bus_perftest.cc
+++ b/media/base/audio_bus_perftest.cc
@@ -18,22 +18,22 @@
scoped_ptr<T[]> interleaved(new T[frame_size]);
const int byte_size = sizeof(T);
- base::TimeTicks start = base::TimeTicks::HighResNow();
+ base::TimeTicks start = base::TimeTicks::Now();
for (int i = 0; i < kBenchmarkIterations; ++i) {
bus->ToInterleaved(bus->frames(), byte_size, interleaved.get());
}
double total_time_milliseconds =
- (base::TimeTicks::HighResNow() - start).InMillisecondsF();
+ (base::TimeTicks::Now() - start).InMillisecondsF();
perf_test::PrintResult(
"audio_bus_to_interleaved", "", trace_name,
total_time_milliseconds / kBenchmarkIterations, "ms", true);
- start = base::TimeTicks::HighResNow();
+ start = base::TimeTicks::Now();
for (int i = 0; i < kBenchmarkIterations; ++i) {
bus->FromInterleaved(interleaved.get(), bus->frames(), byte_size);
}
total_time_milliseconds =
- (base::TimeTicks::HighResNow() - start).InMillisecondsF();
+ (base::TimeTicks::Now() - start).InMillisecondsF();
perf_test::PrintResult(
"audio_bus_from_interleaved", "", trace_name,
total_time_milliseconds / kBenchmarkIterations, "ms", true);
diff --git a/media/base/audio_converter_perftest.cc b/media/base/audio_converter_perftest.cc
index c6a4758..92bff29 100644
--- a/media/base/audio_converter_perftest.cc
+++ b/media/base/audio_converter_perftest.cc
@@ -39,12 +39,12 @@
converter.AddInput(&fake_input2);
converter.AddInput(&fake_input3);
- base::TimeTicks start = base::TimeTicks::HighResNow();
+ base::TimeTicks start = base::TimeTicks::Now();
for (int i = 0; i < kBenchmarkIterations; ++i) {
converter.Convert(output_bus.get());
}
double runs_per_second = kBenchmarkIterations /
- (base::TimeTicks::HighResNow() - start).InSecondsF();
+ (base::TimeTicks::Now() - start).InSecondsF();
perf_test::PrintResult(
"audio_converter", "", trace_name, runs_per_second, "runs/s", true);
}
diff --git a/media/base/demuxer_perftest.cc b/media/base/demuxer_perftest.cc
index 454f478f..42fc6e8 100644
--- a/media/base/demuxer_perftest.cc
+++ b/media/base/demuxer_perftest.cc
@@ -187,11 +187,11 @@
StreamReader stream_reader(&demuxer, false);
// Benchmark.
- base::TimeTicks start = base::TimeTicks::HighResNow();
+ base::TimeTicks start = base::TimeTicks::Now();
while (!stream_reader.IsDone()) {
stream_reader.Read();
}
- base::TimeTicks end = base::TimeTicks::HighResNow();
+ base::TimeTicks end = base::TimeTicks::Now();
total_time += (end - start).InSecondsF();
demuxer.Stop();
QuitLoopWithStatus(&message_loop, PIPELINE_OK);
diff --git a/media/base/sinc_resampler_perftest.cc b/media/base/sinc_resampler_perftest.cc
index b54056af..5ee33481 100644
--- a/media/base/sinc_resampler_perftest.cc
+++ b/media/base/sinc_resampler_perftest.cc
@@ -32,7 +32,7 @@
float (*convolve_fn)(const float*, const float*, const float*, double),
bool aligned,
const std::string& trace_name) {
- base::TimeTicks start = base::TimeTicks::HighResNow();
+ base::TimeTicks start = base::TimeTicks::Now();
for (int i = 0; i < kBenchmarkIterations; ++i) {
convolve_fn(resampler->get_kernel_for_testing() + (aligned ? 0 : 1),
resampler->get_kernel_for_testing(),
@@ -40,7 +40,7 @@
kKernelInterpolationFactor);
}
double total_time_milliseconds =
- (base::TimeTicks::HighResNow() - start).InMillisecondsF();
+ (base::TimeTicks::Now() - start).InMillisecondsF();
perf_test::PrintResult("sinc_resampler_convolve",
"",
trace_name,
diff --git a/media/base/sinc_resampler_unittest.cc b/media/base/sinc_resampler_unittest.cc
index b0bac3a..f3f45c4 100644
--- a/media/base/sinc_resampler_unittest.cc
+++ b/media/base/sinc_resampler_unittest.cc
@@ -141,11 +141,10 @@
kSampleRateRatio, SincResampler::kDefaultRequestSize,
base::Bind(&MockSource::ProvideInput, base::Unretained(&mock_source)));
- base::TimeTicks start = base::TimeTicks::HighResNow();
+ base::TimeTicks start = base::TimeTicks::Now();
for (int i = 1; i < 10000; ++i)
resampler.SetRatio(1.0 / i);
- double total_time_c_ms =
- (base::TimeTicks::HighResNow() - start).InMillisecondsF();
+ double total_time_c_ms = (base::TimeTicks::Now() - start).InMillisecondsF();
printf("SetRatio() took %.2fms.\n", total_time_c_ms);
}
diff --git a/media/base/vector_math_perftest.cc b/media/base/vector_math_perftest.cc
index 2cf4691..ae3b54e 100644
--- a/media/base/vector_math_perftest.cc
+++ b/media/base/vector_math_perftest.cc
@@ -36,7 +36,7 @@
bool aligned,
const std::string& test_name,
const std::string& trace_name) {
- TimeTicks start = TimeTicks::HighResNow();
+ TimeTicks start = TimeTicks::Now();
for (int i = 0; i < kBenchmarkIterations; ++i) {
fn(input_vector_.get(),
kScale,
@@ -44,7 +44,7 @@
output_vector_.get());
}
double total_time_milliseconds =
- (TimeTicks::HighResNow() - start).InMillisecondsF();
+ (TimeTicks::Now() - start).InMillisecondsF();
perf_test::PrintResult(test_name,
"",
trace_name,
@@ -58,12 +58,12 @@
int len,
const std::string& test_name,
const std::string& trace_name) {
- TimeTicks start = TimeTicks::HighResNow();
+ TimeTicks start = TimeTicks::Now();
for (int i = 0; i < kEWMABenchmarkIterations; ++i) {
fn(0.5f, input_vector_.get(), len, 0.1f);
}
double total_time_milliseconds =
- (TimeTicks::HighResNow() - start).InMillisecondsF();
+ (TimeTicks::Now() - start).InMillisecondsF();
perf_test::PrintResult(test_name,
"",
trace_name,
diff --git a/media/base/yuv_convert_perftest.cc b/media/base/yuv_convert_perftest.cc
index c6cacaf..7d3d64c 100644
--- a/media/base/yuv_convert_perftest.cc
+++ b/media/base/yuv_convert_perftest.cc
@@ -67,7 +67,7 @@
TEST_F(YUVConvertPerfTest, ConvertYUVToRGB32Row_SSE) {
ASSERT_TRUE(base::CPU().has_sse());
- base::TimeTicks start = base::TimeTicks::HighResNow();
+ base::TimeTicks start = base::TimeTicks::Now();
for (int i = 0; i < kPerfTestIterations; ++i) {
for (int row = 0; row < kSourceHeight; ++row) {
int chroma_row = row / 2;
@@ -80,8 +80,7 @@
GetLookupTable(YV12));
}
}
- double total_time_seconds =
- (base::TimeTicks::HighResNow() - start).InSecondsF();
+ double total_time_seconds = (base::TimeTicks::Now() - start).InSecondsF();
perf_test::PrintResult(
"yuv_convert_perftest", "", "ConvertYUVToRGB32Row_SSE",
kPerfTestIterations / total_time_seconds, "runs/s", true);
@@ -96,7 +95,7 @@
const int kSourceDx = 80000; // This value means a scale down.
- base::TimeTicks start = base::TimeTicks::HighResNow();
+ base::TimeTicks start = base::TimeTicks::Now();
for (int i = 0; i < kPerfTestIterations; ++i) {
for (int row = 0; row < kSourceHeight; ++row) {
int chroma_row = row / 2;
@@ -110,8 +109,7 @@
GetLookupTable(YV12));
}
}
- double total_time_seconds =
- (base::TimeTicks::HighResNow() - start).InSecondsF();
+ double total_time_seconds = (base::TimeTicks::Now() - start).InSecondsF();
perf_test::PrintResult(
"yuv_convert_perftest", "", "ScaleYUVToRGB32Row_SSE",
kPerfTestIterations / total_time_seconds, "runs/s", true);
@@ -123,7 +121,7 @@
const int kSourceDx = 80000; // This value means a scale down.
- base::TimeTicks start = base::TimeTicks::HighResNow();
+ base::TimeTicks start = base::TimeTicks::Now();
for (int i = 0; i < kPerfTestIterations; ++i) {
for (int row = 0; row < kSourceHeight; ++row) {
int chroma_row = row / 2;
@@ -137,8 +135,7 @@
GetLookupTable(YV12));
}
}
- double total_time_seconds =
- (base::TimeTicks::HighResNow() - start).InSecondsF();
+ double total_time_seconds = (base::TimeTicks::Now() - start).InSecondsF();
perf_test::PrintResult(
"yuv_convert_perftest", "", "LinearScaleYUVToRGB32Row_SSE",
kPerfTestIterations / total_time_seconds, "runs/s", true);
diff --git a/media/midi/midi_manager_alsa.cc b/media/midi/midi_manager_alsa.cc
index 37cbbebb..e4cadfb 100644
--- a/media/midi/midi_manager_alsa.cc
+++ b/media/midi/midi_manager_alsa.cc
@@ -392,8 +392,7 @@
// Read available incoming MIDI data.
snd_seq_event_t* event;
int err = snd_seq_event_input(in_client_, &event);
- double timestamp =
- (base::TimeTicks::HighResNow() - base::TimeTicks()).InSecondsF();
+ double timestamp = (base::TimeTicks::Now() - base::TimeTicks()).InSecondsF();
if (err == -ENOSPC) {
VLOG(1) << "snd_seq_event_input detected buffer overrun";
diff --git a/media/midi/usb_midi_device_android.cc b/media/midi/usb_midi_device_android.cc
index 8f93c3d..ff58e62 100644
--- a/media/midi/usb_midi_device_android.cc
+++ b/media/midi/usb_midi_device_android.cc
@@ -56,7 +56,7 @@
const uint8* head = bytes.size() ? &bytes[0] : NULL;
delegate_->ReceiveUsbMidiData(this, endpoint_number, head, bytes.size(),
- base::TimeTicks::HighResNow());
+ base::TimeTicks::Now());
}
bool UsbMidiDeviceAndroid::RegisterUsbMidiDevice(JNIEnv* env) {
diff --git a/media/test/pipeline_integration_perftest.cc b/media/test/pipeline_integration_perftest.cc
index 81efc909c..e09de39e 100644
--- a/media/test/pipeline_integration_perftest.cc
+++ b/media/test/pipeline_integration_perftest.cc
@@ -24,7 +24,7 @@
PIPELINE_OK,
pipeline.Start(filename, PipelineIntegrationTestBase::kClockless));
- base::TimeTicks start = base::TimeTicks::HighResNow();
+ base::TimeTicks start = base::TimeTicks::Now();
pipeline.Play();
ASSERT_TRUE(pipeline.WaitUntilOnEnded());
@@ -35,7 +35,7 @@
if (audio_only) {
time_seconds += pipeline.GetAudioTime().InSecondsF();
} else {
- time_seconds += (base::TimeTicks::HighResNow() - start).InSecondsF();
+ time_seconds += (base::TimeTicks::Now() - start).InSecondsF();
}
}
diff --git a/net/base/bandwidth_metrics.h b/net/base/bandwidth_metrics.h
index e5f2646..679d65a6 100644
--- a/net/base/bandwidth_metrics.h
+++ b/net/base/bandwidth_metrics.h
@@ -70,7 +70,7 @@
// If we're the only stream, we've finished some idle time. Record a new
// timestamp to indicate the start of data flow.
if (++num_streams_in_progress_ == 1) {
- last_start_ = base::TimeTicks::HighResNow();
+ last_start_ = base::TimeTicks::Now();
bytes_since_last_start_ = 0;
}
}
@@ -86,7 +86,7 @@
if (bytes_since_last_start_ < kRecordSizeThreshold)
return;
- base::TimeDelta delta = base::TimeTicks::HighResNow() - last_start_;
+ base::TimeDelta delta = base::TimeTicks::Now() - last_start_;
double ms = delta.InMillisecondsF();
if (ms > 0.0) {
double kbps = static_cast<double>(bytes_since_last_start_) * 8 / ms;
diff --git a/skia/ext/benchmarking_canvas.cc b/skia/ext/benchmarking_canvas.cc
index 5e00327..257ac3f 100644
--- a/skia/ext/benchmarking_canvas.cc
+++ b/skia/ext/benchmarking_canvas.cc
@@ -210,11 +210,11 @@
AutoStamper::AutoStamper(TimingCanvas *timing_canvas)
: timing_canvas_(timing_canvas) {
- start_ticks_ = base::TimeTicks::HighResNow();
+ start_ticks_ = base::TimeTicks::Now();
}
AutoStamper::~AutoStamper() {
- base::TimeDelta delta = base::TimeTicks::HighResNow() - start_ticks_;
+ base::TimeDelta delta = base::TimeTicks::Now() - start_ticks_;
int command_index = timing_canvas_->tracking_canvas_->CommandCount() - 1;
DCHECK_GE(command_index, 0);
timing_canvas_->timings_map_[command_index] = delta;
diff --git a/tools/gn/trace.cc b/tools/gn/trace.cc
index 036ac53..c8107931 100644
--- a/tools/gn/trace.cc
+++ b/tools/gn/trace.cc
@@ -123,7 +123,7 @@
: item_(nullptr), done_(false) {
if (trace_log) {
item_ = new TraceItem(t, name, base::PlatformThread::CurrentId());
- item_->set_begin(base::TimeTicks::HighResNow());
+ item_->set_begin(base::TimeTicks::Now());
}
}
@@ -132,7 +132,7 @@
if (trace_log) {
item_ = new TraceItem(t, label.GetUserVisibleName(false),
base::PlatformThread::CurrentId());
- item_->set_begin(base::TimeTicks::HighResNow());
+ item_->set_begin(base::TimeTicks::Now());
}
}
@@ -154,7 +154,7 @@
if (!done_) {
done_ = true;
if (trace_log) {
- item_->set_end(base::TimeTicks::HighResNow());
+ item_->set_end(base::TimeTicks::Now());
AddTrace(item_);
}
}
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index 527ea1c..1c84bd2 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -7212,9 +7212,8 @@
Time between input event creation and the renderer receiving and starting to
process the event. For touch events on Windows, we measure from when the
event reaches Chrome, whereas on other platforms we use the timestamp from
- the kernel. On Windows, this metric is only reported when
- |IsHighResNowFastAndReliable| is true, which will introduce some sampling
- bias.
+ the kernel. On Windows, this metric is only reported when |IsHighResolution|
+ is true, which will introduce some sampling bias.
</summary>
</histogram>
@@ -7225,8 +7224,7 @@
starting to process the event. For touch events on Windows, we measure from
when the event reaches Chrome, whereas on other platforms we use the
timestamp from the kernel. On Windows, this metric is only reported when
- |IsHighResNowFastAndReliable| is true, which will introduce some sampling
- bias.
+ |IsHighResolution| is true, which will introduce some sampling bias.
</summary>
</histogram>
@@ -7249,8 +7247,8 @@
reaches the Impl thread. Maximum is 1000ms. On Windows, we measure from when
the touch event reaches Chrome, whereas on other platforms we use the
timestamp from the kernel. On Windows, this metric is only reported when
- |IsHighResNowFastAndReliable| is true, which will introduce some sampling
- bias. This supersedes the Event.Latency.RendererImpl.GestureScroll metric.
+ |IsHighResolution| is true, which will introduce some sampling bias. This
+ supersedes the Event.Latency.RendererImpl.GestureScroll metric.
</summary>
</histogram>
diff --git a/tools/valgrind/gtest_exclude/base_unittests.gtest_win32.txt b/tools/valgrind/gtest_exclude/base_unittests.gtest_win32.txt
index 840a303..dca1b42 100644
--- a/tools/valgrind/gtest_exclude/base_unittests.gtest_win32.txt
+++ b/tools/valgrind/gtest_exclude/base_unittests.gtest_win32.txt
@@ -3,7 +3,6 @@
# Very sensitive to slowdown
TimeTicks.Deltas
-TimeTicks.HighResNow
TimerTest.RepeatingTimer*
# This Windows-native sampling profiler test does not work under our tools
diff --git a/ui/compositor/layer_animator.cc b/ui/compositor/layer_animator.cc
index adff73f..77cfc3b 100644
--- a/ui/compositor/layer_animator.cc
+++ b/ui/compositor/layer_animator.cc
@@ -759,10 +759,7 @@
return false;
}
- // All clear, actually start the sequence. Note: base::TimeTicks::Now has
- // a resolution that can be as bad as 15ms. If this causes glitches in the
- // animations, this can be switched to HighResNow() (animation uses Now()
- // internally).
+ // All clear, actually start the sequence.
// All LayerAnimators share the same LayerAnimatorCollection. Use the
// last_tick_time() from there to ensure animations started during the same
// event complete at the same time.
diff --git a/ui/events/latency_info.cc b/ui/events/latency_info.cc
index 6050d26..bb2215c0 100644
--- a/ui/events/latency_info.cc
+++ b/ui/events/latency_info.cc
@@ -201,7 +201,7 @@
int64 id,
int64 component_sequence_number) {
AddLatencyNumberWithTimestamp(component, id, component_sequence_number,
- base::TimeTicks::HighResNow(), 1);
+ base::TimeTicks::Now(), 1);
}
void LatencyInfo::AddLatencyNumberWithTimestamp(LatencyComponentType component,
@@ -238,7 +238,7 @@
// CrOS). So we need to adjust the diff between in CLOCK_MONOTONIC and
// CLOCK_SYSTEM_TRACE. Note that the diff is drifting overtime so we
// can't use a static value.
- int64 diff = base::TimeTicks::HighResNow().ToInternalValue() -
+ int64 diff = base::TimeTicks::Now().ToInternalValue() -
base::TimeTicks::NowFromSystemTraceTime().ToInternalValue();
ts = component.event_time.ToInternalValue() - diff;
} else {
diff --git a/ui/gl/gl_surface_glx.cc b/ui/gl/gl_surface_glx.cc
index dd3eed9..de888e538 100644
--- a/ui/gl/gl_surface_glx.cc
+++ b/ui/gl/gl_surface_glx.cc
@@ -211,7 +211,7 @@
return;
TRACE_EVENT_INSTANT0("gpu", "vblank", TRACE_EVENT_SCOPE_THREAD);
- now = base::TimeTicks::HighResNow();
+ now = base::TimeTicks::Now();
glXMakeCurrent(display_, 0, 0);
}
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 6345b794..d23127df 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -2470,14 +2470,9 @@
touch_event_type = ui::ET_TOUCH_MOVED;
}
if (touch_event_type != ui::ET_UNKNOWN) {
- base::TimeTicks now;
// input[i].dwTime doesn't necessarily relate to the system time at all,
- // so use base::TimeTicks::HighResNow() if possible, or
- // base::TimeTicks::Now() otherwise.
- if (base::TimeTicks::IsHighResNowFastAndReliable())
- now = base::TimeTicks::HighResNow();
- else
- now = base::TimeTicks::Now();
+ // so use base::TimeTicks::Now()
+ const base::TimeTicks now = base::TimeTicks::Now();
ui::TouchEvent event(touch_event_type,
gfx::Point(point.x, point.y),
id_generator_.GetGeneratedID(input[i].dwID),