Cud u pls pls help in writing a java code to find execution time of application programs like word???

import java.util.*;
public class GetExecutionTimes
{
  public GetExecutionTimes(){}
  public static void main(String args[])
  {
    long startTime = System.currentTimeMillis();
    GetExecutionTimes ext=new GetExecutionTimes();
    ext.callMethod();
    long endTime = System.currentTimeMillis();
    System.out.println("Total elapsed time in execution of 
           method callMethod() is :"+ (endTime-startTime));
  }
  public void callMethod(){
    System.out.println("Calling method");
    for(int i=1;i<=10;i++)
    {
      System.out.println("Value of counter is "+i);
    }
  }
}