Commit 89c5c64c authored by lpy's avatar lpy Committed by Commit bot

Include system time in Mac ThreadTicks.

Currently Mac ComputeThreadTicks doesn't only use user time, this patch includes
system time in order to get more accurate CPU time.

BUG=608936

Review-Url: https://codereview.chromium.org/1946303003
Cr-Commit-Position: refs/heads/master@{#391717}
parent 44ccc478
......@@ -92,9 +92,11 @@ int64_t ComputeThreadTicks() {
MACH_DCHECK(kr == KERN_SUCCESS, kr) << "thread_info";
base::CheckedNumeric<int64_t> absolute_micros(
thread_info_data.user_time.seconds);
thread_info_data.user_time.seconds +
thread_info_data.system_time.seconds);
absolute_micros *= base::Time::kMicrosecondsPerSecond;
absolute_micros += thread_info_data.user_time.microseconds;
absolute_micros += (thread_info_data.user_time.microseconds +
thread_info_data.system_time.microseconds);
return absolute_micros.ValueOrDie();
#endif // defined(OS_IOS)
}
......
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