OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** | 5 /** |
6 * The results of a single block of tests (count times run, overall time). | 6 * The results of a single block of tests (count times run, overall time). |
7 */ | 7 */ |
8 class BlockSample { | 8 class BlockSample { |
9 BlockSample(this.count, this.durationNanos); | 9 BlockSample(this.count, this.durationNanos); |
10 int count; | 10 int count; |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 static void _innerLoop(CPSTest test, int remainingCount, | 413 static void _innerLoop(CPSTest test, int remainingCount, |
414 Function continuation) { | 414 Function continuation) { |
415 if (remainingCount > 1) { | 415 if (remainingCount > 1) { |
416 test(() => _innerLoop(test, remainingCount - 1, continuation)); | 416 test(() => _innerLoop(test, remainingCount - 1, continuation)); |
417 } else { | 417 } else { |
418 continuation(); | 418 continuation(); |
419 } | 419 } |
420 } | 420 } |
421 | 421 |
422 static void _addToEventQueue(Function action) { | 422 static void _addToEventQueue(Function action) { |
423 new Timer(0, _(Timer t) => action()); | 423 Timer.run(action); |
424 } | 424 } |
425 } | 425 } |
426 | 426 |
427 class CountTestConfig { | 427 class CountTestConfig { |
428 CountTestConfig(int this._warmup, int this._reps, | 428 CountTestConfig(int this._warmup, int this._reps, |
429 [int blocksize = -1, ReportHandler reportHandler = null]) { | 429 [int blocksize = -1, ReportHandler reportHandler = null]) { |
430 this._blocksize = blocksize; | 430 this._blocksize = blocksize; |
431 this._reportHandler = (null == reportHandler) ? | 431 this._reportHandler = (null == reportHandler) ? |
432 _(TestReport r) => r.printReport() : reportHandler; | 432 _(TestReport r) => r.printReport() : reportHandler; |
433 } | 433 } |
(...skipping 15 matching lines...) Expand all Loading... |
449 _(TestReport r) => r.printReport() : reportHandler; | 449 _(TestReport r) => r.printReport() : reportHandler; |
450 } | 450 } |
451 | 451 |
452 Function _reportHandler; | 452 Function _reportHandler; |
453 Function get reportHandler => _reportHandler; | 453 Function get reportHandler => _reportHandler; |
454 int _warmup; | 454 int _warmup; |
455 int _targetTimeMs; | 455 int _targetTimeMs; |
456 int _minSampleTimeMs; | 456 int _minSampleTimeMs; |
457 int _blocksize; | 457 int _blocksize; |
458 } | 458 } |
OLD | NEW |