Index: src/counters.cc |
diff --git a/src/counters.cc b/src/counters.cc |
index 183941206e91be18e65bddc9a8bdce2cc953dfaa..e2530a8fc1fb58d98ba12e1a42b84cad833d6590 100644 |
--- a/src/counters.cc |
+++ b/src/counters.cc |
@@ -60,8 +60,7 @@ void* Histogram::CreateHistogram() const { |
// Start the timer. |
void HistogramTimer::Start() { |
if (Enabled()) { |
- stop_time_ = 0; |
- start_time_ = OS::Ticks(); |
+ timer_.Start(); |
} |
if (FLAG_log_internal_timer_events) { |
LOG(isolate(), TimerEvent(Logger::START, name())); |
@@ -72,10 +71,9 @@ void HistogramTimer::Start() { |
// Stop the timer and record the results. |
void HistogramTimer::Stop() { |
if (Enabled()) { |
- stop_time_ = OS::Ticks(); |
// Compute the delta between start and stop, in milliseconds. |
- int milliseconds = static_cast<int>(stop_time_ - start_time_) / 1000; |
- AddSample(milliseconds); |
+ AddSample(static_cast<int>(timer_.Elapsed().InMilliseconds())); |
+ timer_.Stop(); |
} |
if (FLAG_log_internal_timer_events) { |
LOG(isolate(), TimerEvent(Logger::END, name())); |