Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-1504

StopWatch: steps feature

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • lang.time.*
    • None

    Description

      Would be great if we could use StopWatch to track times on many places of our code.

      I created a new feature called "steps". 

       

      With this feature we can add label to each step and then get a report with time between each step.

       

      Example:

      final StopWatch watch = new StopWatch();
      
      watch.step("starting");
      
      exampleGoSleep();
      watch.step("sleeping");
      
      exampleGoWalk();
      watch.step("walking ");
      
      exampleGoDance();
      watch.step("dancing ");
      
      System.out.println(watch.getStepsReport());
      

      The output would be:

      [starting] 0ms
      [sleeping] 235ms
      [walking ] 20ms
      [dancing ] 458ms
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              topera Topera
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 3h
                  3h