| Index: src/profile-generator.cc
|
| diff --git a/src/profile-generator.cc b/src/profile-generator.cc
|
| index 86bd17b70a08b304dd40af5424127a3659436714..838b682663a464c3667048d80458f3245bb4d947 100644
|
| --- a/src/profile-generator.cc
|
| +++ b/src/profile-generator.cc
|
| @@ -376,8 +376,8 @@ CpuProfile::CpuProfile(const char* title, unsigned uid, bool record_samples)
|
| : title_(title),
|
| uid_(uid),
|
| record_samples_(record_samples),
|
| - start_time_us_(OS::Ticks()),
|
| - end_time_us_(0) {
|
| + start_time_(Time::NowFromSystemTime()) {
|
| + timer_.Start();
|
| }
|
|
|
|
|
| @@ -388,10 +388,11 @@ void CpuProfile::AddPath(const Vector<CodeEntry*>& path) {
|
|
|
|
|
| void CpuProfile::CalculateTotalTicksAndSamplingRate() {
|
| - end_time_us_ = OS::Ticks();
|
| + TimeDelta duration = timer_.Elapsed();
|
| + end_time_ = start_time_ + duration;
|
| top_down_.CalculateTotalTicks();
|
|
|
| - double duration_ms = (end_time_us_ - start_time_us_) / 1000.;
|
| + double duration_ms = duration.InMillisecondsF();
|
| if (duration_ms < 1) duration_ms = 1;
|
| unsigned ticks = top_down_.root()->total_ticks();
|
| double rate = ticks / duration_ms;
|
|
|