Answers for "how to get a run time of a method in java"

1

java execution time

long start = System.currentTimeMillis();
class.method();
long time = System.currentTimeMillis() - start;
Posted by: Guest on January-15-2021
0

running time of java program

long startTime = System.nanoTime();
.....your program....
long endTime   = System.nanoTime();
long totalTime = endTime - startTime;
System.out.println(totalTime);
Posted by: Guest on June-05-2021

Code answers related to "how to get a run time of a method in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language