commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ottobackwards <...@git.apache.org>
Subject [GitHub] commons-lang issue #311: LANG-1373 Stopwatch based capability for nested, na...
Date Tue, 27 Feb 2018 14:10:07 GMT
Github user ottobackwards commented on the issue:

    https://github.com/apache/commons-lang/pull/311
  
    same with the static factory:
    
    ```java
     @Test
        public void testTryWithResourcesStaticFactory() {
            final StopWatch stopWatch = new StopWatch();
    
            try(StackWatch<String,String> watch = StackWatch.startStackWatch("testStackWatch"))
{
                stopWatch.start();
                stopWatch.stop();
            }
            watch.visit(new StackWatch.TimingVisitor<String,String>() {
                @Override
                public void visitTiming(int level, List<String> path, StackWatch.Timing<String,String>
node) {
                    assertTrue(node.getStopWatch().getNanoTime() > stopWatch.getNanoTime());
                }
            });
        }
    ```


---

Mime
View raw message