Package dclong.util

Examples of dclong.util.Timer.start()


import dclong.util.Timer;

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


public class TestCombination {
  public static void main(String[] args){
    Timer timer = new Timer();
    Combination comb = new Combination(6,3);
    timer.start();
    dclong.io.Console.print(comb.nextCombination());
    System.out.print("\n");
    dclong.io.Console.print(comb.nextCombination());
    System.out.print("\n");
    System.out.println("---------------------");
View Full Code Here

    int sequentialTerminationCriteria = 10;
    int numberOfPermutations = 1000 - 1;
    int numberOfReps = 1000;
    //-----------------------------------------------
    Timer timer = new Timer();
    timer.start();
    SPTsRep sptRep = new SPTsRep(rng,cs,data,sizeOfFirstGroup,
        sequentialTerminationCriteria,numberOfPermutations,numberOfReps);
    sptRep.run();
    sptRep.save(outputFile);
    timer.stop();
View Full Code Here

    int numberOfPermutations = 1000;
    //-------------------------------------------------
    SPTsImpl spt = new SPTsImpl(rng,cs,data,sizeOfFirstGroup,
        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

    double[][] data = BinaryReader.readDouble(inputFile, numberOfTests, sizeOfEachDataSet);
    int[][] randomIndexOfCombinations = generateRandomIndexOfCombinations(rng,numberOfTests,numberOfPermutations,upperBound);
    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.");
  }
View Full Code Here

        numberOfTrueNulls, lambda, sizeOfFirstGroup, sizeOfSecondGroup,
        sequentialTerminationCriteria, numberOfPermutations,
        numberOfSimulations);
    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.");
    // ---------------------------------
View Full Code Here

    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";
    timer.start();
    spt.parSimulateIndependent(outputFile);
//    spt.simulateIndependent(outputFile);
    timer.stop();
    System.out.println(outputFile + " is done. The time used is: "+timer.getElapsedTime()/60000d+" minutes.");
    // ----------------------------------
View Full Code Here

    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";
    timer.start();
    spt.parSimulateIndependent(outputFile);
//    spt.simulateIndependent(outputFile);
    timer.stop();
    System.out.println(outputFile + " is done. The time used is: "+timer.getElapsedTime()/60000d+" minutes.");
    // ----------------------------------
View Full Code Here

    spt.setNumberOfTrueNulls(numberOfTrueNulls);
    // -----------------------
    lambda = 1;
    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.");
    // ---------------------------------
View Full Code Here

    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";
    timer.start();
    spt.parSimulateIndependent(outputFile);
//    spt.simulateIndependent(outputFile);
    timer.stop();
    System.out.println(outputFile + " is done. The time used is: "+timer.getElapsedTime()/60000d+" minutes.");
    // -----------------------------------
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.