To measure the processing time in Java, there are the currentTimeMillis method that measures in milliseconds and the nanoTime method that measures in nanoseconds. This time, it is a method of measuring in nanoseconds and outputting in seconds.
double start = System.nanoTime();
//Describe the process you want to measure
double end = System.nanoTime();
System.out.println("processing time:" + ((end - start) / Math.pow(10, 9)) + "s");
Recommended Posts