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

Unified Diff: pkg/analyzer/lib/src/generated/utilities_general.dart

Issue 128443003: Analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes for review comments. 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 | « pkg/analyzer/lib/src/generated/source_io.dart ('k') | pkg/analyzer/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/utilities_general.dart
diff --git a/pkg/analyzer/lib/src/generated/utilities_general.dart b/pkg/analyzer/lib/src/generated/utilities_general.dart
index 2d7b26dc9967c797cdbf7595d6abe38be6ad211a..50517d8d6b78a2476e9417fc55d3167ad303ef92 100644
--- a/pkg/analyzer/lib/src/generated/utilities_general.dart
+++ b/pkg/analyzer/lib/src/generated/utilities_general.dart
@@ -3,18 +3,16 @@
library engine.utilities.general;
-import 'java_core.dart';
-
/**
* Helper for measuring how much time is spent doing some operation.
*/
class TimeCounter {
- int _result = 0;
+ Stopwatch _sw = new Stopwatch();
/**
* @return the number of milliseconds spent between [start] and [stop].
*/
- int get result => _result;
+ int get result => _sw.elapsedMilliseconds;
/**
* Starts counting time.
@@ -28,18 +26,16 @@ class TimeCounter {
* The handle object that should be used to stop and update counter.
*/
class TimeCounter_TimeCounterHandle {
- final TimeCounter TimeCounter_this;
-
- int _startTime = JavaSystem.currentTimeMillis();
+ final TimeCounter _counter;
- TimeCounter_TimeCounterHandle(this.TimeCounter_this);
+ TimeCounter_TimeCounterHandle(this._counter) {
+ _counter._sw.start();
+ }
/**
* Stops counting time and updates counter.
*/
void stop() {
- {
- TimeCounter_this._result += JavaSystem.currentTimeMillis() - _startTime;
- }
+ _counter._sw.stop();
}
}
« no previous file with comments | « pkg/analyzer/lib/src/generated/source_io.dart ('k') | pkg/analyzer/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698