what i want to do is to find the the time consumed by firing a certain method so i am using System.currentTimeMillis() before and after the method then get the difference but, is there other way since getting the currentTimeMillis is also time consumable and i am working on increasing the performance of a certain protocol. here what i have did
public void someMethod
{
long x=System.currentTimeMillis();
... my bussiness
long y=System.currentTimeMillis();
int timeConsucmed =y-x;
}