Advertisement
Guest User

Untitled

a guest
Jan 20th, 2018
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.70 KB | None | 0 0
  1. package ductsim;
  2.  
  3. import java.io.BufferedWriter;
  4. import java.io.File;
  5. import java.io.FileWriter;
  6. import java.io.IOException;
  7. import java.util.ArrayList;
  8. import java.util.List;
  9. import java.util.concurrent.ThreadLocalRandom;
  10.  
  11. /**
  12.  *
  13.  * @author Santiago
  14.  */
  15. public class test2 {
  16.    
  17.     public static void main(String[] args)
  18.     {
  19.         int nGens = 5000;
  20.         double startTime, endTime, duration1, duration2, duration4;
  21.        
  22.         startTime = System.nanoTime();
  23.         Duct duct1 = new Duct(200, 10, true, 2); // Last arg. = number of threads
  24.         duct1.execute(nGens);
  25.         endTime = System.nanoTime();
  26.         duration1 = (endTime - startTime);
  27.         System.out.println("Parallel: " + duration1/ 1000000000.0);
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement