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

Allow a StopWatch to carry an optional message.

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.10
    • lang.time.*
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: