I often look at the code in the System.nanoTime () pair to synchronize it. Something like:
long start = System.nanoTime(); methodToBeTimed(); long elapsedTime = System.nanoTime() - start;
Is there any good time library that helps with this problem? A home code will also be accepted.
N.B.
The profiler is not a solution here, since I want to use some time limits in my unit tests, so I want to use synchronization methods programmatically .
java performance timing
dfa Aug 6 '09 at 6:00 2009-08-06 06:00
source share