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

Unified Diff: runtime/vm/timer.cc

Issue 145323002: Post-meetup feature extravaganza. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 11 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') | tests/standalone/vmservice/isolate_bad_class_test.dart » ('j') | 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 32126)
+++ runtime/vm/timer.cc (working copy)
@@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/timer.h"
+#include "vm/json_stream.h"
namespace dart {
@@ -25,8 +26,8 @@
#define TIMER_FIELD_REPORT(name, msg) \
- if (name().enabled() && name().message() != NULL) { \
- OS::Print("%s %" Pd64 " micros.\n", \
+ if (name().report() && name().message() != NULL) { \
+ OS::Print("%s : %" Pd64 " micros.\n", \
name().message(), \
name().TotalElapsedTime()); \
}
@@ -35,4 +36,19 @@
}
#undef TIMER_FIELD_REPORT
+
+#define JSON_TIMER(name, msg) \
+ { \
+ JSONObject jsobj(&jsarr); \
+ jsobj.AddProperty("name", #name); \
+ double seconds = static_cast<double>(name().TotalElapsedTime()) / \
+ static_cast<double>(kMicrosecondsPerSecond); \
+ jsobj.AddProperty("time", seconds); \
+ }
+void TimerList::PrintTimersToJSONProperty(JSONObject* jsobj) {
+ JSONArray jsarr(jsobj, "timers");
+ TIMER_LIST(JSON_TIMER);
+}
+#undef JSON_TIMER
+
} // namespace dart
« no previous file with comments | « runtime/vm/timer.h ('k') | tests/standalone/vmservice/isolate_bad_class_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698