Github user garydgregory commented on the issue:

    https://github.com/apache/commons-lang/pull/311
  
    Hi All:
    
    Have you considered allowing the timer to be used in a try-with-resources 
statement such that 
    
    ```
    StackWatch<String,String> watch = new StackWatch<>("OuterFunction");
    watch.start();
    functionOne(watch);
    watch.stop();
    ```
    
    Becomes perhaps:
    
    ```
    try (StackWatch<String,String> watch = new 
StackWatch<>("OuterFunction").start()) {
       functionOne(watch);
    }
    ```
    
    or more succinctly:
    
    ```
    try (StackWatch<String,String> watch = StackWatch.start("OuterFunction")) {
       functionOne(watch);
    }
    ```
     
    ?
    
    Gary


---

Reply via email to