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

Side by Side Diff: utils/tests/string_encoding/benchmark_runner.dart

Issue 9597015: Update Timer API to take the callback as the last parameter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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 | « tools/testing/dart/test_suite.dart ('k') | no next file » | 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) 2011, 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;
11 int durationNanos; 11 int durationNanos;
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 static void _innerLoop(CPSTest test, int remainingCount, 414 static void _innerLoop(CPSTest test, int remainingCount,
415 Function continuation) { 415 Function continuation) {
416 if (remainingCount > 1) { 416 if (remainingCount > 1) {
417 test(() => _innerLoop(test, remainingCount - 1, continuation)); 417 test(() => _innerLoop(test, remainingCount - 1, continuation));
418 } else { 418 } else {
419 continuation(); 419 continuation();
420 } 420 }
421 } 421 }
422 422
423 static void _addToEventQueue(Function action) { 423 static void _addToEventQueue(Function action) {
424 new Timer(_(Timer t) => action(), 0); 424 new Timer(0, _(Timer t) => action());
425 } 425 }
426 } 426 }
427 427
428 class CountTestConfig { 428 class CountTestConfig {
429 CountTestConfig(int this._warmup, int this._reps, 429 CountTestConfig(int this._warmup, int this._reps,
430 [int blocksize = -1, ReportHandler reportHandler = null]) { 430 [int blocksize = -1, ReportHandler reportHandler = null]) {
431 this._blocksize = blocksize; 431 this._blocksize = blocksize;
432 this._reportHandler = (null == reportHandler) ? 432 this._reportHandler = (null == reportHandler) ?
433 _(TestReport r) => r.printReport() : reportHandler; 433 _(TestReport r) => r.printReport() : reportHandler;
434 } 434 }
(...skipping 15 matching lines...) Expand all
450 _(TestReport r) => r.printReport() : reportHandler; 450 _(TestReport r) => r.printReport() : reportHandler;
451 } 451 }
452 452
453 Function _reportHandler; 453 Function _reportHandler;
454 Function get reportHandler() => _reportHandler; 454 Function get reportHandler() => _reportHandler;
455 int _warmup; 455 int _warmup;
456 int _targetTimeMs; 456 int _targetTimeMs;
457 int _minSampleTimeMs; 457 int _minSampleTimeMs;
458 int _blocksize; 458 int _blocksize;
459 } 459 }
OLDNEW
« no previous file with comments | « tools/testing/dart/test_suite.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698