I am using a spring Stopwatch in way that is presented in this link http://www.wikijava.org/wiki/Spring_Timer.
I would like to measure nested parts of method, i.e. have statistics that would output total time needed for execution of method x and also time needed for execution of parts of a another method y that is called from the method x, or method z which is called from y and so on. (nested calls).
But I can not do this, it gives me an error that Stopwatch is already running and can’t stop it twice. Please, do you have any advice on how to accomplish this.
Any kind of help is appreciated.
Thanks in advance,
mismas
I don’t think the Spring Stopwatch is that fancy, that you can have nested measurements like you want. What you would need to do to measure each nested layer with a new StopWatch instance. If you wanted the output to look nested, you might be able to experiment with using the prettyPrint from one stopWatch as the task name for another, but I’m not sure how that will turn out.