long startTime = System.currentTimeMillis();
for (int i=0; i<1000; i++) {
methodUnderTest();
}
System.out.println("Avg. method execution time=" +
((System.currentTimeMillis() - startTime)/1000));
A java blog with a collection of examples and tutorials on Java and related technologies. (Under maintenance with continuous updates) Be in touch with java jazzle or k2java.blogspot.com.
Showing posts with label Execution time. Show all posts
Showing posts with label Execution time. Show all posts
Tuesday, February 8, 2011
Measuring time taken by the program in java
Subscribe to:
Posts (Atom)