Mercurial > projects > ldc
comparison tango/example/cluster/tclient.d @ 132:1700239cab2e trunk
[svn r136] MAJOR UNSTABLE UPDATE!!!
Initial commit after moving to Tango instead of Phobos.
Lots of bugfixes...
This build is not suitable for most things.
author | lindquist |
---|---|
date | Fri, 11 Jan 2008 17:57:40 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
131:5825d48b27d1 | 132:1700239cab2e |
---|---|
1 /******************************************************************************* | |
2 | |
3 | |
4 *******************************************************************************/ | |
5 | |
6 import Add; | |
7 | |
8 import tango.io.Stdout; | |
9 | |
10 import tango.time.StopWatch; | |
11 | |
12 import tango.util.log.Configurator; | |
13 | |
14 import tango.net.cluster.tina.ClusterTask; | |
15 | |
16 /******************************************************************************* | |
17 | |
18 | |
19 *******************************************************************************/ | |
20 | |
21 void main (char[][] args) | |
22 { | |
23 // an implicit task instance | |
24 auto add = new NetCall!(add); | |
25 | |
26 // an explicit task instance | |
27 auto sub = new Subtract; | |
28 | |
29 StopWatch w; | |
30 while (true) | |
31 { | |
32 w.start; | |
33 for (int i=10000; i--;) | |
34 { | |
35 // both task types are used in the same manner | |
36 add (1, 2); | |
37 sub (3, 4); | |
38 } | |
39 Stdout.formatln ("{} calls/s", 20000/w.stop); | |
40 } | |
41 } | |
42 |