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

Unified Diff: dart/site/try/poi/repeat_poi.dart

Issue 621233003: Count number of iterations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r40933 Created 6 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/site/try/poi/repeat_poi.dart
diff --git a/dart/site/try/poi/repeat_poi.dart b/dart/site/try/poi/repeat_poi.dart
index 24e837af5d474d752574522b132fe052b2665dbc..32a704fc1ae6b29bc9cd0a5fd58a3bf217718209 100644
--- a/dart/site/try/poi/repeat_poi.dart
+++ b/dart/site/try/poi/repeat_poi.dart
@@ -4,6 +4,14 @@
import 'poi.dart' as poi;
+int count = 0;
+
+int MAX_ITERATIONS =
+ const int.fromEnvironment('MAX_ITERATIONS', defaultValue: null);
+
main(arguments) {
+ count++;
+ if (MAX_ITERATIONS != null && count > MAX_ITERATIONS) return;
+ print('\n\n\n\nIteration #$count.');
poi.main(arguments).then((_) => main(arguments));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698