You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2020/01/19 02:43:35 UTC

[GitHub] [commons-lang] topera commented on issue #482: LANG-1504 - Adding steps feature to StopWatch

topera commented on issue #482: LANG-1504 - Adding steps feature to StopWatch
URL: https://github.com/apache/commons-lang/pull/482#issuecomment-575960153
 
 
   Hello Mr. Gregory,
   
   Thank you for your answer.
   I'm also glad that part of my suggestion was already accepted and done on LANG-1506 (putting labels on the timer)
   
   About your points:
   * I agree to use **split** name.
   * About **feature creep**, IMHO this is a good feature: with small lines of code we can make the StopWatch much more useful, mainly to detect performance bottlenecks on the code.
   * Use case: the developer wants to know which operation is slower. He/she can simply add many split() calls and label then as follow:
   
   ```
           final StopWatch watch = StopWatch.createStarted();
   
           watch.split("Baking cookies");
           ...
           watch.split("Serving cookies");
           ...
           watch.split("Eating cookies");
           ...
           watch.getSplitReport();
   
   ```
   The output would be (with or without the percentage indicator)
   
   ```
           Baking cookies  00:07:00.000 - 70%
           Serving         00:01:00.000 - 10%
           Eating          00:02:00.000 - 20%
   ```
   
   If you and other members of the team agrees, I'll proceed with the implementation.
   Note: this is my first try on open source projects, so please sorry if I'm skipping some important step on the process.
   
   Regards

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services