1public class SomeClass{
2 public void somePublicMethod()
3 {
4 long startTime = System.currentTimeMillis();
5 someMethodWhichYouWantToProfile();
6 long endTime = System.currentTimeMillis();
7 System.out.println("Total execution time: " + (endTime-startTime) + "ms");
8 }
9 }
10