[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.platform] Re: measure runtime of a java program using Eclipse
|
"Tarek Garoui" <tgaroui@xxxxxxxx> wrote in message
news:3feb1f8f1df3aab2d3575579bad008a7$1@xxxxxxxxxxxxxxxxxx
> Hello,
>
> I would like to measure the runtime of a java program. I am using Eclipse.
> Can somebody tell me how it works ?
There are two answers I can think of offhand. One is to use a Java
profiling tool, such as Eclipse TPTP. This will give you extremely detailed
information at the cost of a fairly steep learning curve.
The other is to write a test wrapper (shell script, Java class with a main()
method, JUnit test...) that checks the system time, calls your program, and
then checks the system time again and spits out the difference. If you
choose, you could build this functionality right into your program,
controlled for instance with a command line argument or system property.
Which one of those solutions is right for you depends on your goals.