I have an interface IMath having add, subtract methods
public interface IMath {
long add(int x, int y);
long sub(int x, int y);
}
Now a class Math implementing this is having the body for these methods.
public class Math implements IMath {
@Override
public long add(int x, int y) {
return x + y;
}
@Override
public long sub(int x, int y) {
return x - y;
}
}
I want the execution time for each method without using AOP, Reflection and no changes should be there in the method code.
Please suggest various ways to do this