Guest User

test

a guest
Jun 30th, 2015
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 0.36 KB | None | 0 0
  1. import vibe.d;
  2. import std.stdio;
  3.  
  4. const NTHREADS = 10000;
  5.  
  6. void main() {
  7.     runTask({
  8.         auto tasks = new Task[NTHREADS];
  9.         StopWatch sw;
  10.         sw.start();
  11.         foreach(ref task; tasks) task = runTask({
  12.             sleep(100.msecs);
  13.         });
  14.         foreach(ref task; tasks) task.join();
  15.         sw.stop();
  16.         writeln(sw.peek().msecs, "ms");
  17.         exitEventLoop();
  18.     });
  19.     runEventLoop();
  20. }
Advertisement
Add Comment
Please, Sign In to add comment