Published
- 1 min read
running time of java program
The solution for this is noted below
running time of java program
Solution
long startTime = System.nanoTime();
.....your program....
long endTime = System.nanoTime();
long totalTime = endTime - startTime;
System.out.println(totalTime);
Try other methods by searching on the site. That is if this doesn’t work