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

Unified Diff: src/counters.cc

Issue 23690003: Revert "Add Chromium-style TimeDelta, Time and TimeTicks classes, and a new ElapsedTimer class." (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/counters.h ('k') | src/cpu-profiler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/counters.cc
diff --git a/src/counters.cc b/src/counters.cc
index e2530a8fc1fb58d98ba12e1a42b84cad833d6590..183941206e91be18e65bddc9a8bdce2cc953dfaa 100644
--- a/src/counters.cc
+++ b/src/counters.cc
@@ -60,7 +60,8 @@ void* Histogram::CreateHistogram() const {
// Start the timer.
void HistogramTimer::Start() {
if (Enabled()) {
- timer_.Start();
+ stop_time_ = 0;
+ start_time_ = OS::Ticks();
}
if (FLAG_log_internal_timer_events) {
LOG(isolate(), TimerEvent(Logger::START, name()));
@@ -71,9 +72,10 @@ 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.
- AddSample(static_cast<int>(timer_.Elapsed().InMilliseconds()));
- timer_.Stop();
+ int milliseconds = static_cast<int>(stop_time_ - start_time_) / 1000;
+ AddSample(milliseconds);
}
if (FLAG_log_internal_timer_events) {
LOG(isolate(), TimerEvent(Logger::END, name()));
« no previous file with comments | « src/counters.h ('k') | src/cpu-profiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698