Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B41E02009A0 for ; Sat, 21 May 2016 22:15:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B2A8A160A04; Sat, 21 May 2016 20:15:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0848E160A02 for ; Sat, 21 May 2016 22:15:13 +0200 (CEST) Received: (qmail 92154 invoked by uid 500); 21 May 2016 20:15:13 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 92141 invoked by uid 99); 21 May 2016 20:15:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 21 May 2016 20:15:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 06B292C1F58 for ; Sat, 21 May 2016 20:15:13 +0000 (UTC) Date: Sat, 21 May 2016 20:15:13 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (LANG-1236) Add StopWatch#getTime with String Format Argument MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 21 May 2016 20:15:14 -0000 [ https://issues.apache.org/jira/browse/LANG-1236?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15295239#comment-15295239 ] ASF GitHub Bot commented on LANG-1236: -------------------------------------- GitHub user NickManley opened a pull request: https://github.com/apache/commons-lang/pull/153 LANG-1236: Add StopWatch#getTime with String Format Argument I wasn't sure if this kind of thing should be a part of the getTime method or if toString should be overloaded to take a format argument. Either way seems okay to me. I put it on getTime, but if there are disagreements about that, I would be okay with putting it in toString instead. You can merge this pull request into a Git repository by running: $ git pull https://github.com/NickManley/commons-lang formatted_getTime Alternatively you can review and apply these changes as the patch at: https://github.com/apache/commons-lang/pull/153.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 #153 ---- commit 9f6797d93172b1d79298e5ca63e995f2242f3f04 Author: Nick Manley Date: 2016-05-21T18:53:49Z LANG-1223: Add StopWatch#getTime(TimeUnit) commit 82a58a0b11c3086781bd526dc596e33889bd3f3a Author: Nick Manley Date: 2016-05-21T20:06:06Z Add String formatting to StopWatch#getTime ---- > Add StopWatch#getTime with String Format Argument > ------------------------------------------------- > > Key: LANG-1236 > URL: https://issues.apache.org/jira/browse/LANG-1236 > Project: Commons Lang > Issue Type: Improvement > Components: lang.time.* > Reporter: Nick Manley > Priority: Minor > > Add a version of the StopWatch#getTime method which takes a String to format the time in the desired format. > {code} > StopWatch watch= StopWatch.createStarted(); > // sleep for 1 hour, 19 minutes, 45.554 seconds > try {Thread.sleep(4785554);} catch (final InterruptedException ex) {} > watch.stop(); > System.out.println(watch.getTime("HH:mm:ss.SSS"); > // prints: 1:19:45.554 > {code} > I have a patch ready, but I wasn't sure if this kind of thing should be a part of the getTime method or if toString should be overloaded to take a format argument. Either way seems okay to me. I put it on getTime, but if there are disagreements about that, I would be okay with putting it in toString instead. -- This message was sent by Atlassian JIRA (v6.3.4#6332)