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

Side by Side Diff: pkg/analyzer/lib/src/util/utilities_timing.dart

Issue 725143004: Format and sort analyzer and analysis_server packages. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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/task/task_dart.dart ('k') | pkg/analyzer/test/enum_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library engine.utilities.timing; 5 library engine.utilities.timing;
6 6
7 /** 7 /**
8 * A `CountedStopwatch` is a [Stopwatch] that counts the number of times the 8 * A `CountedStopwatch` is a [Stopwatch] that counts the number of times the
9 * stop method has been invoked. 9 * stop method has been invoked.
10 */ 10 */
11 class CountedStopwatch extends Stopwatch { 11 class CountedStopwatch extends Stopwatch {
12 /** 12 /**
13 * The number of times the [stop] method has been invoked. 13 * The number of times the [stop] method has been invoked.
14 */ 14 */
15 int stopCount = 0; 15 int stopCount = 0;
16 16
17 /** 17 /**
18 * Initialize a newly created stopwatch. 18 * Initialize a newly created stopwatch.
19 */ 19 */
20 CountedStopwatch(); 20 CountedStopwatch();
21 21
22 /** 22 /**
23 * The average number of millisecond that were recorded each time the [start] 23 * The average number of millisecond that were recorded each time the [start]
24 * and [stop] methods were invoked. 24 * and [stop] methods were invoked.
25 */ 25 */
26 int get averageMilliseconds => elapsedMilliseconds ~/ stopCount; 26 int get averageMilliseconds => elapsedMilliseconds ~/ stopCount;
27 27
28 @override 28 @override
29 void reset() {
30 super.reset();
31 stopCount = 0;
32 }
33
34 @override
29 void stop() { 35 void stop() {
30 super.stop(); 36 super.stop();
31 stopCount++; 37 stopCount++;
32 } 38 }
33 39 }
34 @override
35 void reset() {
36 super.reset();
37 stopCount = 0;
38 }
39 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/task/task_dart.dart ('k') | pkg/analyzer/test/enum_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698