michaldo commented on pull request #709:
URL: https://github.com/apache/commons-lang/pull/709#issuecomment-774331817


   BTW, split has a bug: if stop watch is suspended and resumed, startTimeNanos 
is moved forward but stopTimeNanos not. For example:
   ```
   watch.start()
   watch.split()
   watch.suspend()
   sleep(100ms)
   watch.resume()
   watch.getSplitTime() // -100
   ```
   IMHO split is overengineering. Instead of 
`split()->getSplitTime()->unsplit()` I can just call `watch.getTime()` when I 
need. I suggest delete split functionality at all.
   
   BTW2, I suggest also drop `reset`, because buying brand new StopWatch cost 
nothing.
   BTW3, I suggest also drop a `stop`, because  when StopWatch is done, caller 
just calls `watch.getTime()` and does not care StopWatch anymore. There is no 
battery nor thread inside the StopWatch, and `stop`  is not needed.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to