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

Unified Diff: third_party/pkg/angular/lib/perf/dev_tools_timeline.dart

Issue 124053002: Adding Angular and dependent packages for testing (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 12 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
Index: third_party/pkg/angular/lib/perf/dev_tools_timeline.dart
diff --git a/third_party/pkg/angular/lib/perf/dev_tools_timeline.dart b/third_party/pkg/angular/lib/perf/dev_tools_timeline.dart
new file mode 100644
index 0000000000000000000000000000000000000000..fa4c9e2346720bb21c37de7a4590cc14cbb9b581
--- /dev/null
+++ b/third_party/pkg/angular/lib/perf/dev_tools_timeline.dart
@@ -0,0 +1,20 @@
+part of angular.perf;
+
+class DevToolsTimelineProfiler extends Profiler {
+ final dom.Console console = dom.window.console;
+ String prefix = '';
+
+ int startTimer(String name, [String extraData]) {
+ console.time('$prefix$name');
+ prefix = '$prefix ';
+ }
+
+ void stopTimer(dynamic name) {
+ prefix = prefix.length > 0 ? prefix.substring(0, prefix.length - 2) : prefix;
+ console.timeEnd('$prefix$name');
+ }
+
+ void markTime(String name, [String extraData]) {
+ console.timeStamp('$prefix$name');
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698