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; | 5 library test.timing; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 import 'dart:math'; | 9 import 'dart:math'; |
10 | 10 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 * Perform any operations that need to be performed once before any iterations
. | 82 * Perform any operations that need to be performed once before any iterations
. |
83 */ | 83 */ |
84 Future oneTimeSetUp() { | 84 Future oneTimeSetUp() { |
85 initializeInttestMixin(); | 85 initializeInttestMixin(); |
86 server = new Server(); | 86 server = new Server(); |
87 sourceDirectory = Directory.systemTemp.createTempSync('analysisServer'); | 87 sourceDirectory = Directory.systemTemp.createTempSync('analysisServer'); |
88 Completer serverConnected = new Completer(); | 88 Completer serverConnected = new Completer(); |
89 onServerConnected.listen((_) { | 89 onServerConnected.listen((_) { |
90 serverConnected.complete(); | 90 serverConnected.complete(); |
91 }); | 91 }); |
92 return server.start().then((params) { | 92 skipShutdown = true; |
93 server.listenToOutput(dispatchNotification); | 93 return server.start(dispatchNotification, profileServer: true).then((params)
{ |
| 94 server.listenToOutput(dispatchNotification); |
94 server.exitCode.then((_) { | 95 server.exitCode.then((_) { |
95 skipShutdown = true; | 96 skipShutdown = true; |
96 }); | 97 }); |
97 return serverConnected.future; | 98 return serverConnected.future; |
98 }); | 99 }); |
99 } | 100 } |
100 | 101 |
101 /** | 102 /** |
102 * Perform any operations that need to be performed before each iteration. | 103 * Perform any operations that need to be performed before each iteration. |
103 */ | 104 */ |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 */ | 311 */ |
311 List<int> toMilliseconds(List<int> times) { | 312 List<int> toMilliseconds(List<int> times) { |
312 int count = times.length; | 313 int count = times.length; |
313 List<int> convertedValues = new List<int>(); | 314 List<int> convertedValues = new List<int>(); |
314 for (int i = 0; i < count; i++) { | 315 for (int i = 0; i < count; i++) { |
315 convertedValues.add(times[i] ~/ NANOSECONDS_PER_MILLISECOND); | 316 convertedValues.add(times[i] ~/ NANOSECONDS_PER_MILLISECOND); |
316 } | 317 } |
317 return convertedValues; | 318 return convertedValues; |
318 } | 319 } |
319 } | 320 } |
OLD | NEW |