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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer/lib/src/generated/source_io.dart ('k') | pkg/analyzer/pubspec.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // This code was auto-generated, is not intended to be edited, and is subject to 1 // This code was auto-generated, is not intended to be edited, and is subject to
2 // significant change. Please see the README file for more information. 2 // significant change. Please see the README file for more information.
3 3
4 library engine.utilities.general; 4 library engine.utilities.general;
5 5
6 import 'java_core.dart';
7
8 /** 6 /**
9 * Helper for measuring how much time is spent doing some operation. 7 * Helper for measuring how much time is spent doing some operation.
10 */ 8 */
11 class TimeCounter { 9 class TimeCounter {
12 int _result = 0; 10 Stopwatch _sw = new Stopwatch();
13 11
14 /** 12 /**
15 * @return the number of milliseconds spent between [start] and [stop]. 13 * @return the number of milliseconds spent between [start] and [stop].
16 */ 14 */
17 int get result => _result; 15 int get result => _sw.elapsedMilliseconds;
18 16
19 /** 17 /**
20 * Starts counting time. 18 * Starts counting time.
21 * 19 *
22 * @return the [TimeCounterHandle] that should be used to stop counting. 20 * @return the [TimeCounterHandle] that should be used to stop counting.
23 */ 21 */
24 TimeCounter_TimeCounterHandle start() => new TimeCounter_TimeCounterHandle(thi s); 22 TimeCounter_TimeCounterHandle start() => new TimeCounter_TimeCounterHandle(thi s);
25 } 23 }
26 24
27 /** 25 /**
28 * The handle object that should be used to stop and update counter. 26 * The handle object that should be used to stop and update counter.
29 */ 27 */
30 class TimeCounter_TimeCounterHandle { 28 class TimeCounter_TimeCounterHandle {
31 final TimeCounter TimeCounter_this; 29 final TimeCounter _counter;
32 30
33 int _startTime = JavaSystem.currentTimeMillis(); 31 TimeCounter_TimeCounterHandle(this._counter) {
34 32 _counter._sw.start();
35 TimeCounter_TimeCounterHandle(this.TimeCounter_this); 33 }
36 34
37 /** 35 /**
38 * Stops counting time and updates counter. 36 * Stops counting time and updates counter.
39 */ 37 */
40 void stop() { 38 void stop() {
41 { 39 _counter._sw.stop();
42 TimeCounter_this._result += JavaSystem.currentTimeMillis() - _startTime;
43 }
44 } 40 }
45 } 41 }
OLDNEW
« 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