long starTime=System.currentTimeMills(); .... .... long endTime=System.currentTimeMills(); long time=endTime-starTime;