Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
0.8.0
-
None
-
None
Description
getDuration will produce unexpected results when the StopWatch has been stopped.
Currently, if the stopwatch has been stopped it returns the current nanos since epoch - (-1), which is meaningless at best and likely to cause issues for applications using this method.
It should either return an exception because the elapsed time has no meaning after being stopped, or return the elapsed time when the watch was stopped, or just keep going and return the current value.
The following gist demonstrates the problem:
https://gist.github.com/harschware/6974b61837618574bae6ab75369ead30