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

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

Issue 12213092: Rework Timer interface. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 10 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 | « utils/tests/pub/version_solver_test.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) 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
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
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 }
OLDNEW
« no previous file with comments | « utils/tests/pub/version_solver_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698