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

Side by Side Diff: example/runner_pool.dart

Issue 1025293003: pkg/isolate: library renaming, removed unused method, fix creation of TimeoutException (Closed) Base URL: https://github.com/dart-lang/isolate.git@master
Patch Set: nits Created 5 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
« no previous file with comments | « example/runner-pool.dart ('k') | lib/isolate.dart » ('j') | 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 dart.pkg.isolate.sample.runners; 5 library isolate.example.runner_pool;
6 6
7 import "package:isolate/loadbalancer.dart"; 7 import 'dart:async' show Future, Completer;
8 import "package:isolate/isolaterunner.dart"; 8
9 import "dart:async" show Future, Completer; 9 import 'package:isolate/load_balancer.dart';
10 import 'package:isolate/isolate_runner.dart';
10 11
11 void main() { 12 void main() {
12 int N = 44; 13 int N = 44;
13 var sw = new Stopwatch()..start(); 14 var sw = new Stopwatch()..start();
14 // Compute fib up to 42 with 4 isolates. 15 // Compute fib up to 42 with 4 isolates.
15 parfib(N, 4).then((v1) { 16 parfib(N, 4).then((v1) {
16 var t1 = sw.elapsedMilliseconds; 17 var t1 = sw.elapsedMilliseconds;
17 sw.stop(); 18 sw.stop();
18 sw.reset(); 19 sw.reset();
19 print("fib#4(${N}) = ${v1[N]}, ms: $t1"); 20 print("fib#4(${N}) = ${v1[N]}, ms: $t1");
(...skipping 28 matching lines...) Expand all
48 49
49 int computeFib(n) { 50 int computeFib(n) {
50 int result = fib(n); 51 int result = fib(n);
51 return result; 52 return result;
52 } 53 }
53 54
54 int fib(n) { 55 int fib(n) {
55 if (n < 2) return n; 56 if (n < 2) return n;
56 return fib(n - 1) + fib(n - 2); 57 return fib(n - 1) + fib(n - 2);
57 } 58 }
OLDNEW
« no previous file with comments | « example/runner-pool.dart ('k') | lib/isolate.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698