How do you time the execution of a java program? I’m not sure what class I should use to do this.
I’m kinda looking for something like:
// Some timer starts here
for (int i = 0; i < length; i++) {
// Do something
}
// End timer here
System.out.println("Total execution time: " + totalExecutionTime);
1 Answer