user1007522, I donβt know why your code is not working (it seems asfer already commented on this), but I had the same problem getting 0 miliseconds from com.google.common.base.Stopwatch.
I was doing
Stopwatch stopwatch = new Stopwatch(); doSomething(); logger.info("test took:" + stopwatch);
Now i do
Stopwatch stopwatch = new Stopwatch().start(); doSomething(); stopwatch.stop(); logger.info("test took:" + stopwatch);
and it works, I get "test took: 26.81 s"
kckdqj Oct 16 '13 at 15:32 2013-10-16 15:32
source share