hi,
how would you measure the execution time of a java method?
Thomas Weidenfeller - 14 Jun 2005 08:12 GMT
> how would you measure the execution time of a java method?
I guess you want to know how you could do it. You could e.g. run a
profiler, or use the difference of two calls to System.currentTimeMillis().
/Thomas

Signature
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
Alexander Lueck - 14 Jun 2005 08:15 GMT
> how would you measure the execution time of a java method?
long start = System.currentTimeMillis();
...
doSomething();
...
long end = System.currentTimeMillis();
System.out.println("Execution time was "+(end-start)+" ms.");
Greetings
Alex
Jeremy Watts - 14 Jun 2005 10:07 GMT
> > how would you measure the execution time of a java method?
>
[quoted text clipped - 9 lines]
>
> Alex
Many thanks
Jeremy