Skip to content

Commit

Permalink
[profiler] fix sleeping on windows for long intervals.
Browse files Browse the repository at this point in the history
R=franzih@chromium.org

Change-Id: I5717db794fc797e7c3b0b8f122ddb6dc0702a99e
Reviewed-on: https://chromium-review.googlesource.com/941126
Reviewed-by: Franziska Hinkelmann <franzih@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51755}
  • Loading branch information
hashseed authored and Commit Bot committed Mar 6, 2018
1 parent d2c2b39 commit 43e2fb1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/profiler/cpu-profiler.cc
Expand Up @@ -170,10 +170,11 @@ void ProfilerEventsProcessor::Run() {
// jitter, which is unacceptable for short profile intervals.
while (base::TimeTicks::HighResolutionNow() < nextSampleTime) {
}
}
#else
base::OS::Sleep(nextSampleTime - now);
} else // NOLINT
#endif
{
base::OS::Sleep(nextSampleTime - now);
}
}

// Schedule next sample. sampler_ is nullptr in tests.
Expand Down

0 comments on commit 43e2fb1

Please sign in to comment.