summaryrefslogtreecommitdiffstats
path: root/gpu/perftests
diff options
context:
space:
mode:
authorfdoray <fdoray@chromium.org>2015-10-14 20:46:40 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-15 03:47:30 +0000
commitdc2a659b0ad54c3dcb632b876e40a71fa03019e9 (patch)
treee3f3a87c7e8a03716389609435214f0be6bd87bf /gpu/perftests
parent5d49f7978f42d05431b8ed851050ce0687938512 (diff)
downloadchromium_src-dc2a659b0ad54c3dcb632b876e40a71fa03019e9.zip
chromium_src-dc2a659b0ad54c3dcb632b876e40a71fa03019e9.tar.gz
chromium_src-dc2a659b0ad54c3dcb632b876e40a71fa03019e9.tar.bz2
Implement ThreadTicks::Now on Windows.
Use QueryThreadCycleTime() to get the number of CPU clock cycles used by the current thread. Convert it to microseconds using a measured TSC frequency. The value returned by QueryThreadCycleTime() is based on the rdtsc instruction. For several years, Intel has been shipping CPUs with a constant-rate counter, which means that the QueryThreadCycleTime() results are directly proportional to wall-clock time on most systems (see crbug.com/280743#c15). ThreadTicks::IsSupported() will return false if the CPU doesn't have a constant rate TSC. BUG=280743 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1390743002 Cr-Commit-Position: refs/heads/master@{#354213}
Diffstat (limited to 'gpu/perftests')
-rw-r--r--gpu/perftests/measurements.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/gpu/perftests/measurements.cc b/gpu/perftests/measurements.cc
index b2dac91..645784d 100644
--- a/gpu/perftests/measurements.cc
+++ b/gpu/perftests/measurements.cc
@@ -57,6 +57,7 @@ MeasurementTimers::MeasurementTimers(gfx::GPUTimingClient* gpu_timing_client)
DCHECK(gpu_timing_client);
wall_time_start_ = base::TraceTicks::Now();
if (base::ThreadTicks::IsSupported()) {
+ base::ThreadTicks::WaitUntilInitialized();
cpu_time_start_ = base::ThreadTicks::Now();
} else {
static bool logged_once = false;