Computing time

Help
andre
2013-05-03
2013-05-30
  • andre
    andre
    2013-05-03

    Hi,
    this question may seem stupid, but I found nothing helpful…

    I need to print the computing time of the labeling (among all), should I use the "TimeStamp"?

    In general, how can I get the computing time of a solution?

    Thanks,
    Andrea

     
  • kris
    kris
    2013-05-03

    Hi!

    You can use several methods to do that. Check JaCoP examples that contain one method. For example, encapsulating code in the following parts will measure real-time of the program execution.

    long T1, T2;
    T1 = System.currentTimeMillis();

    // here the code you want to measure execution time

    T2 = System.currentTimeMillis();

    System.out.println("\n\t*** Execution time = " + (T2 - T1) + " ms");

    Alternatively, you can use time of the tread. The code you can find in JaCoP.fz.Fz2jacop.java.

    Best,
    /Kris

     
  • andre
    andre
    2013-05-03

    Fair enough! I'm sorry, I was used to obtain this type of statistics directly by the solvers' library.

    Thank you!