Δευτέρα, 6 Οκτωβρίου 2008

Calculate the execution time

//variables
private long start;
private long end;

//Put this before the main code
start = System.currentTimeMillis();

//Main code here

//Put this at the end of the code
end = System.currentTimeMillis();

System.out.println("Completed in +"+(end-start)+"ms");

Δεν υπάρχουν σχόλια: