Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(947)

Unified Diff: src/profile-generator.cc

Issue 22189002: Revert "Return start/end profiling time in microseconds instead of milliseconds" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/profile-generator.h ('k') | test/cctest/test-cpu-profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/profile-generator.cc
diff --git a/src/profile-generator.cc b/src/profile-generator.cc
index e772a546471e029665960a62020399d5fe096aad..4e2e38988a34a29b7f3331bd18532cf01c9bb131 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_ms_(OS::TimeCurrentMillis()),
+ end_time_ms_(0) {
}
@@ -388,13 +388,13 @@ void CpuProfile::AddPath(const Vector<CodeEntry*>& path) {
void CpuProfile::CalculateTotalTicksAndSamplingRate() {
- end_time_us_ = OS::Ticks();
+ end_time_ms_ = OS::TimeCurrentMillis();
top_down_.CalculateTotalTicks();
- double duration_ms = (end_time_us_ - start_time_us_) / 1000.;
- if (duration_ms < 1) duration_ms = 1;
+ double duration = end_time_ms_ - start_time_ms_;
+ if (duration < 1) duration = 1;
unsigned ticks = top_down_.root()->total_ticks();
- double rate = ticks / duration_ms;
+ double rate = ticks / duration;
top_down_.SetTickRatePerMs(rate);
}
« no previous file with comments | « src/profile-generator.h ('k') | test/cctest/test-cpu-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698