LOG=N
BUG=363976
R=bmeurer@chromium.org, yurys@chromium.org
Review URL: https://codereview.chromium.org/
243033002
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20866
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
const CpuProfileNode* GetSample(int index) const;
/**
- * Returns time when the profile recording started (in microseconds
- * since the Epoch).
+ * Returns time when the profile recording was started (in microseconds)
+ * since some unspecified starting point.
*/
int64_t GetStartTime() const;
/**
- * Returns time when the profile recording was stopped (in microseconds
- * since the Epoch).
+ * Returns time when the profile recording was stopped (in microseconds)
+ * since some unspecified starting point. The point is however equal to the
+ * starting point used by GetStartTime.
*/
int64_t GetEndTime() const;
int64_t CpuProfile::GetStartTime() const {
const i::CpuProfile* profile = reinterpret_cast<const i::CpuProfile*>(this);
- return (profile->start_time() - i::Time::UnixEpoch()).InMicroseconds();
+ return (profile->start_time() - i::TimeTicks()).InMicroseconds();
}
int64_t CpuProfile::GetEndTime() const {
const i::CpuProfile* profile = reinterpret_cast<const i::CpuProfile*>(this);
- return (profile->end_time() - i::Time::UnixEpoch()).InMicroseconds();
+ return (profile->end_time() - i::TimeTicks()).InMicroseconds();
}
CpuProfile::CpuProfile(const char* title, bool record_samples)
: title_(title),
record_samples_(record_samples),
- start_time_(Time::NowFromSystemTime()) {
- timer_.Start();
+ start_time_(TimeTicks::HighResolutionNow()) {
}
void CpuProfile::CalculateTotalTicksAndSamplingRate() {
- end_time_ = start_time_ + timer_.Elapsed();
+ end_time_ = TimeTicks::HighResolutionNow();
}
int samples_count() const { return samples_.length(); }
ProfileNode* sample(int index) const { return samples_.at(index); }
- Time start_time() const { return start_time_; }
- Time end_time() const { return end_time_; }
+ TimeTicks start_time() const { return start_time_; }
+ TimeTicks end_time() const { return end_time_; }
void UpdateTicksScale();
private:
const char* title_;
bool record_samples_;
- Time start_time_;
- Time end_time_;
- ElapsedTimer timer_;
+ TimeTicks start_time_;
+ TimeTicks end_time_;
List<ProfileNode*> samples_;
ProfileTree top_down_;