Commit f7758dfa authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

Log error instead of DCHECK in absence of high resolution ticks clock.

Turns out this path is used in the wild for logs and counters.

We may eventually want to split TimedHistograms based on low resolution
clocks to avoid polluting metrics but for now just make it a warning
to raise awereness when debugging in such an environment.

R=hpayer@chromium.org

Bug: chromium:809016
Change-Id: I5f2dd511d5fce730256979d58212468f08a2d680
Reviewed-on: https://chromium-review.googlesource.com/904045Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51130}
parent 5eca0acc
......@@ -459,7 +459,16 @@ struct timeval Time::ToTimeval() const {
// static
TimeTicks TimeTicks::HighResolutionNow() {
DCHECK(TimeTicks::IsHighResolution());
static bool verified_high_resolution_available = false;
if (!verified_high_resolution_available) {
if (!TimeTicks::IsHighResolution()) {
OS::PrintError(
"\n\n"
"WARNING: High-resolution TimeTicks are not available on this system."
"\n\n");
}
verified_high_resolution_available = true;
}
return TimeTicks::Now();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment