Package dclong.util

Examples of dclong.util.Timer.begin()


public class TestSpeed {
  public static void main(String[] args) {
    RandomGenerator rg = new Well44497b();
    RandomDataImpl rng = new RandomDataImpl(rg);
    Timer timer = new Timer();
    timer.begin();
    final int MAX_THREADS = Runtime.getRuntime().availableProcessors();
    ExecutorService pool = Executors.newFixedThreadPool(MAX_THREADS);
    for (int i = 0; i < 10000; i++) {
      pool.execute(new RandomPermutationRunnable(rng, 2869, 330));
    }
View Full Code Here


        e.printStackTrace();
      }
    }
    timer.end();
    timer.printSeconds("generating random numbers in parallel");
    timer.begin();
    for (int i = 0; i < 10000; i++) {
//      rng.nextPermutation(2869, 330);
      for (int j = 0; j < 100000; j++) {
        Math.pow(j, 8);
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.