view tango/example/cluster/tclient.d @ 358:051f5b550d9c trunk

[svn r379] Fix slice assigns of the form T[] = T when T is a typedef. Fixes run/a/array_initialization_20_B, D, F, H.
author ChristianK
date Mon, 14 Jul 2008 12:39:23 +0200
parents 1700239cab2e
children
line wrap: on
line source

/*******************************************************************************


*******************************************************************************/

import Add;

import tango.io.Stdout;

import tango.time.StopWatch;

import tango.util.log.Configurator;

import tango.net.cluster.tina.ClusterTask;

/*******************************************************************************


*******************************************************************************/

void main (char[][] args)
{
        // an implicit task instance
        auto add = new NetCall!(add);

        // an explicit task instance
        auto sub = new Subtract;

        StopWatch w;
        while (true)
              {
              w.start;
              for (int i=10000; i--;)
                  {
                  // both task types are used in the same manner
                  add (1, 2);
                  sub (3, 4);
                  }
              Stdout.formatln ("{} calls/s", 20000/w.stop);
              }
}