1

I have a method in java

Public Object someMethod (String param) ( //some calculations Return Object ) 

I want to test the performance of this method ( how much time would it take to reach to db and return an object ) How can I do this? I don't have a main method because its a library. I use unit tests to check if it works. Help.

0

1 Answer 1

1

I would use JMH, which is an excellent framework for doing microbenchmarks

http://openjdk.java.net/projects/code-tools/jmh/

It is used all the time by engineers that develops the JDK.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.