Commit 1332be4a authored by lpy's avatar lpy Committed by Commit bot

Add missing system time in Mac ThreadTicks.

Currently Mac ComputeThreadTicks only uses user time, this patch adds system
time in order to get more accurate CPU time.

BUG=v8:4984
LOG=n

Review-Url: https://codereview.chromium.org/2016513002
Cr-Commit-Position: refs/heads/master@{#36538}
parent 37d3ad89
...@@ -41,9 +41,11 @@ int64_t ComputeThreadTicks() { ...@@ -41,9 +41,11 @@ int64_t ComputeThreadTicks() {
CHECK(kr == KERN_SUCCESS); CHECK(kr == KERN_SUCCESS);
v8::base::CheckedNumeric<int64_t> absolute_micros( v8::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 *= v8::base::Time::kMicrosecondsPerSecond; absolute_micros *= v8::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(); return absolute_micros.ValueOrDie();
} }
#elif V8_OS_POSIX #elif V8_OS_POSIX
......
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