| OLD | NEW |
| 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 test.timing.simple; | 5 library test.timing.simple; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:io'; |
| 8 | 9 |
| 9 import 'package:analysis_server/src/protocol.dart'; | 10 import 'package:analysis_server/src/protocol.dart'; |
| 10 import 'package:path/path.dart'; | 11 import 'package:path/path.dart'; |
| 11 | 12 |
| 12 import '../timing_framework.dart'; | 13 import '../timing_framework.dart'; |
| 13 | 14 |
| 14 /** | 15 /** |
| 15 * Perform the timing test, printing the minimum, average and maximum times, as | 16 * Perform the timing test, printing the minimum, average and maximum times, as |
| 16 * well as the standard deviation to the output. | 17 * well as the standard deviation to the output. |
| 17 */ | 18 */ |
| 18 void main(List<String> args) { | 19 void main(List<String> args) { |
| 19 SimpleTest test = new SimpleTest(); | 20 SimpleTest test = new SimpleTest(); |
| 20 test.run().then((TimingResult result) { | 21 test.run().then((TimingResult result) { |
| 21 print('minTime = ${result.minTime}'); | 22 print('minTime = ${result.minTime}'); |
| 22 print('averageTime = ${result.averageTime}'); | 23 print('averageTime = ${result.averageTime}'); |
| 23 print('maxTime = ${result.maxTime}'); | 24 print('maxTime = ${result.maxTime}'); |
| 24 print('standardDeviation = ${result.standardDeviation}'); | 25 print('standardDeviation = ${result.standardDeviation}'); |
| 26 print(''); |
| 27 print('Press return to exit'); |
| 28 return stdin.first; |
| 25 }); | 29 }); |
| 26 } | 30 } |
| 27 | 31 |
| 28 /** | 32 /** |
| 29 * A test of how long it takes to get code completion results after making a | 33 * A test of how long it takes to get code completion results after making a |
| 30 * minor change inside a method body. | 34 * minor change inside a method body. |
| 31 */ | 35 */ |
| 32 class SimpleTest extends TimingTest { | 36 class SimpleTest extends TimingTest { |
| 33 /** | 37 /** |
| 34 * The path to the file in which code completion is to be performed. | 38 * The path to the file in which code completion is to be performed. |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 sendCompletionGetSuggestions(mainFilePath, cursorOffset + 1); | 105 sendCompletionGetSuggestions(mainFilePath, cursorOffset + 1); |
| 102 return completionReceived.future; | 106 return completionReceived.future; |
| 103 } | 107 } |
| 104 | 108 |
| 105 @override | 109 @override |
| 106 Future tearDown() { | 110 Future tearDown() { |
| 107 sendAnalysisSetAnalysisRoots([], []); | 111 sendAnalysisSetAnalysisRoots([], []); |
| 108 return new Future.value(); | 112 return new Future.value(); |
| 109 } | 113 } |
| 110 } | 114 } |
| OLD | NEW |