Package dclong.util

Examples of dclong.util.Timer.stop()


public class TestTimer {
  public static void main(String[] args) throws InterruptedException{
    Timer timer = new Timer();
    timer.start();
    Thread.sleep(1000);
    timer.stop();
    timer.printSeconds("sleeping");
  }
}
View Full Code Here


    System.out.print("\n");
    dclong.io.Console.print(comb.nextCombination());
    System.out.print("\n");
    System.out.println("---------------------");
    int[][] cs = comb.getCombinations(comb.getTotal().intValue());
    timer.stop();
    int[][] cs2 = new int[cs.length/2][cs[0].length*2];
    for(int i=0; i<cs2.length; ++i){
      for(int j=0; j<cs2[0].length/2; ++j){
        cs2[i][j] = cs[i][j];
      }
View Full Code Here

    timer.start();
    SPTsRep sptRep = new SPTsRep(rng,cs,data,sizeOfFirstGroup,
        sequentialTerminationCriteria,numberOfPermutations,numberOfReps);
    sptRep.run();
    sptRep.save(outputFile);
    timer.stop();
    System.out.println("The time used is " + timer.getElapsedTime()/1000d + " seconds.");
  }
}
View Full Code Here

        sequentialTerminationCriteria,numberOfPermutations);
    Timer timer = new Timer();
    timer.start();
    spt.run();
    spt.saveOutput(outputFile);
    timer.stop();
    System.out.println("Time used is: "+timer.getElapsedTime()/1000d);
  }
}
View Full Code Here

    SPTsRunnable spt = new SPTsRunnable(cs,data,randomIndexOfCombinations,
        sizeOfFirstGroup,sequentialTerminationCriteria,output,simulationIndex);
    Timer timer = new Timer();
    timer.start();
    spt.run();
    timer.stop();
    saveOutput(output,outputFile);
    System.out.println("The time used is :"+timer.getElapsedTime()/1000d+" seconds.");
  }
 
  private static int[][] generateRandomIndexOfCombinations(RandomDataImpl rng,int numberOfTests,
View Full Code Here

    for (int i = 0; i < 130000000; ++i) {
      for(int j=0; j<100; ++j){
        rng.nextInt(0, upperBound);
      }
    }
    timer.stop();
    System.out.println("Warm-up is done. The time used is " + timer.getElapsedTime()/60000d + " minutes.");
    // -------------------------------------------------------------
    int numberOfTests = 10000;
    int sizeOfFirstGroup = 8;
    int sizeOfSecondGroup = 8;
View Full Code Here

    String outputFile = "i-999-10-" + numberOfTrueNulls + "-" + lambda
        + ".bin";
    timer.start();
    spt.parSimulateIndependent(outputFile);
//    spt.simulateIndependent(outputFile);
    timer.stop();
    System.out.println(outputFile + " is done. The time used is: "+timer.getElapsedTime()/60000d+" minutes.");
    // ---------------------------------
    lambda = 2;
    spt.setLambda(lambda);
    outputFile = "i-999-10-" + numberOfTrueNulls + "-" + lambda + ".bin";
View Full Code Here

    spt.setLambda(lambda);
    outputFile = "i-999-10-" + numberOfTrueNulls + "-" + lambda + ".bin";
    timer.start();
    spt.parSimulateIndependent(outputFile);
//    spt.simulateIndependent(outputFile);
    timer.stop();
    System.out.println(outputFile + " is done. The time used is: "+timer.getElapsedTime()/60000d+" minutes.");
    // ----------------------------------
    lambda = 3;
    spt.setLambda(lambda);
    outputFile = "i-999-10-" + numberOfTrueNulls + "-" + lambda + ".bin";
View Full Code Here

    spt.setLambda(lambda);
    outputFile = "i-999-10-" + numberOfTrueNulls + "-" + lambda + ".bin";
    timer.start();
    spt.parSimulateIndependent(outputFile);
//    spt.simulateIndependent(outputFile);
    timer.stop();
    System.out.println(outputFile + " is done. The time used is: "+timer.getElapsedTime()/60000d+" minutes.");
    // ----------------------------------
    numberOfTrueNulls = 9000;
    spt.setNumberOfTrueNulls(numberOfTrueNulls);
    // -----------------------
View Full Code Here

    spt.setLambda(lambda);
    outputFile = "i-999-10-" + numberOfTrueNulls + "-" + lambda + ".bin";
    timer.start();
    spt.parSimulateIndependent(outputFile);
//    spt.simulateIndependent(outputFile);
    timer.stop();
    System.out.println(outputFile + " is done. The time used is: "+timer.getElapsedTime()/60000d+" minutes.");
    // ---------------------------------
    lambda = 2;
    spt.setLambda(lambda);
    outputFile = "i-999-10-" + numberOfTrueNulls + "-" + lambda + ".bin";
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.