java calculate method run time


long startTime = System.currentTimeMillis();

doReallyLongThing(); // call your method here
long endTime = System.currentTimeMillis();
// calculate the difference - that the method just took to executeSystem.out.println("That took " + (endTime - startTime) + " milliseconds");

No comments :

Post a Comment

Your Comment and Question will help to make this blog better...