Is there a command in java to measure the execution time?
Is there a command in java to measure the execution time ? Something like System.out.println(execution.time); in the end of the code. RoflcoptrException Here is a complete and little modified example on how you could do that: public class ExecutionTimer { private long start; private long end; public ExecutionTimer() { reset(); start = System.currentTimeMillis(); } public void end() { end = System.currentTimeMillis(); } public long duration(){ return (end-start); } public void reset() { start = 0; end = 0; } public static void main(String s[]) { // simple example ExecutionTimer t = new