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

Unified Diff: runtime/vm/timer.cc

Issue 215893006: Extend Timer to track longest contiguous interval, and add GC timer. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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 | « runtime/vm/timer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/timer.cc
===================================================================
--- runtime/vm/timer.cc (revision 34675)
+++ runtime/vm/timer.cc (working copy)
@@ -2,6 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+#include "platform/globals.h"
#include "vm/timer.h"
#include "vm/json_stream.h"
@@ -27,9 +28,10 @@
#define TIMER_FIELD_REPORT(name, msg) \
if (name().report() && name().message() != NULL) { \
- OS::Print("%s : %" Pd64 " micros.\n", \
+ OS::Print("%s : %.3f ms total; %.3f ms max.\n", \
name().message(), \
- name().TotalElapsedTime()); \
+ MicrosecondsToMilliseconds(name().TotalElapsedTime()), \
+ MicrosecondsToMilliseconds(name().MaxContiguous())); \
}
void TimerList::ReportTimers() {
TIMER_LIST(TIMER_FIELD_REPORT);
@@ -41,9 +43,10 @@
{ \
JSONObject jsobj(&jsarr); \
jsobj.AddProperty("name", #name); \
- double seconds = static_cast<double>(name().TotalElapsedTime()) / \
- static_cast<double>(kMicrosecondsPerSecond); \
- jsobj.AddProperty("time", seconds); \
+ jsobj.AddProperty("time", \
+ MicrosecondsToSeconds(name().TotalElapsedTime())); \
+ jsobj.AddProperty("max_contiguous", \
+ MicrosecondsToSeconds(name().MaxContiguous())); \
}
void TimerList::PrintTimersToJSONProperty(JSONObject* jsobj) {
JSONArray jsarr(jsobj, "timers");
« no previous file with comments | « runtime/vm/timer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698