You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by NickManley <gi...@git.apache.org> on 2016/05/21 18:57:49 UTC

[GitHub] commons-lang pull request: LANG-1223: Add StopWatch#getTime(TimeUn...

GitHub user NickManley opened a pull request:

    https://github.com/apache/commons-lang/pull/152

    LANG-1223: Add StopWatch#getTime(TimeUnit)

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/NickManley/commons-lang LANG-1223

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/commons-lang/pull/152.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #152
    
----
commit 9f6797d93172b1d79298e5ca63e995f2242f3f04
Author: Nick Manley <ni...@outlook.com>
Date:   2016-05-21T18:53:49Z

    LANG-1223: Add StopWatch#getTime(TimeUnit)

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: LANG-1223: Add StopWatch#getTime(TimeUn...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/commons-lang/pull/152


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: LANG-1223: Add StopWatch#getTime(TimeUn...

Posted by NickManley <gi...@git.apache.org>.
Github user NickManley commented on the pull request:

    https://github.com/apache/commons-lang/pull/152#issuecomment-222108893
  
    I added a convenience method to the StopWatchTest for creating a suspended StopWatch with an arbitrary time using FieldUtils as you suggested.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: LANG-1223: Add StopWatch#getTime(TimeUn...

Posted by PascalSchumacher <gi...@git.apache.org>.
Github user PascalSchumacher commented on the pull request:

    https://github.com/apache/commons-lang/pull/152#issuecomment-222173183
  
    Thanks! :+1: 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: LANG-1223: Add StopWatch#getTime(TimeUn...

Posted by NickManley <gi...@git.apache.org>.
Github user NickManley commented on the pull request:

    https://github.com/apache/commons-lang/pull/152#issuecomment-222092368
  
    The StopWatch times are private, so I can't create a mock StopWatch to test it comprehensively. I did however write a simple unit test to verify that sleeping for 600ms will output 0 seconds and that as soon as it passes 1000ms, it reports 1 second.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: LANG-1223: Add StopWatch#getTime(TimeUn...

Posted by PascalSchumacher <gi...@git.apache.org>.
Github user PascalSchumacher commented on the pull request:

    https://github.com/apache/commons-lang/pull/152#issuecomment-222094283
  
    Thanks for updating the pull request.
    
    Yes, the `StopWatch` implementation is not really testable. :(
    
    I think the best approach would be to use reflection to set the times (e.g. by using `FieldUtils#writeField`).
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request: LANG-1223: Add StopWatch#getTime(TimeUn...

Posted by PascalSchumacher <gi...@git.apache.org>.
Github user PascalSchumacher commented on the pull request:

    https://github.com/apache/commons-lang/pull/152#issuecomment-221348587
  
    Hi Nick,
    
    thanks for the pull request. :)
    
    I think for completeness there should be at least one unit test. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---