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.
Advertisement
No comments yet.