How to time Java program execution speed
- by George Mic
Sorry if this sounds like a dumb question but 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);
Thanks