Dreamlover

dream helps to start-end & again…

Getting the Excution time

Today morning I have taken some sample  statistics using the currentTimeMillis() method on a Object holding 10 milllion of data to find out particular data .This method I found after making a search to getting the Current Time masured in milli .

 So for calculate the Execution time of code..

  long StartTime=System.currentTimeMillis();

………………………………………code goes here…….

long EndTime=System.currentTimeMillis();

System.out.print(“Elapsed time:”+(EndTime-StartTime)); 

Any way, Sometimes it shows unexpected time.

Ok..keep in touch. 

July 4, 2006 Posted by | Java | Leave a Comment

   

Follow

Get every new post delivered to your Inbox.