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

Allow a StopWatch to carry an optional message.

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.10
    • Component/s: lang.time.*
    • Labels:
      None

      Description

      Allow a StopWatch to carry an optional message such that it is included as a prefix to toString and toSplitString methods if present. Quite handy for subclassing.

      The behavior does not change if no message is supplied.

      For example:

      StopWatch stopWatch = new StopWatch("Baking cookies");
      stopWatch.start();
      ...
      

      Calling:

      stopWatch.toString();
      stopWatch.toSplitString();
      

      returns the message as a prefix. for example:

      "Baking cookies 00:01:22.333"
      

        Attachments

          Activity

            People

            • Assignee:
              ggregory Gary D. Gregory
              Reporter:
              ggregory Gary D. Gregory
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: