You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Topera (Jira)" <ji...@apache.org> on 2020/01/19 02:07:00 UTC

[jira] [Updated] (LANG-1504) StopWatch: steps feature

     [ https://issues.apache.org/jira/browse/LANG-1504?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Topera updated LANG-1504:
-------------------------
    External issue ID: https://issues.apache.org/jira/browse/LANG-1506

Part of this feature was done later on a new task (LANG-1506, by [~ggregory] )

Now we can use label for the timer, but only one label for the entire Timer "session"

 

Let's check if this task is still required.

 

> StopWatch: steps feature
> ------------------------
>
>                 Key: LANG-1504
>                 URL: https://issues.apache.org/jira/browse/LANG-1504
>             Project: Commons Lang
>          Issue Type: New Feature
>          Components: lang.time.*
>            Reporter: Topera
>            Priority: Major
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> 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:
> {code:java}
> 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());
> {code}
> The output would be:
> {noformat}
> [starting] 0ms
> [sleeping] 235ms
> [walking ] 20ms
> [dancing ] 458ms
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)