You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2019/04/12 20:19:00 UTC

[jira] [Commented] (KARAF-6235) Date.getTime() can be changed to System.currentTimeMillis()

    [ https://issues.apache.org/jira/browse/KARAF-6235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16816613#comment-16816613 ] 

ASF GitHub Bot commented on KARAF-6235:
---------------------------------------

bd2019us commented on pull request #810: KARAF-6235:use System.currentTimeMillis()
URL: https://github.com/apache/karaf/pull/810
 
 
   new Date() is just a thin wrapper around System.currentTimeMillis(). Using System.currentTimeMillis() can help speed up the system
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Date.getTime() can be changed to System.currentTimeMillis()
> -----------------------------------------------------------
>
>                 Key: KARAF-6235
>                 URL: https://issues.apache.org/jira/browse/KARAF-6235
>             Project: Karaf
>          Issue Type: Bug
>            Reporter: bd2019us
>            Priority: Major
>
> Hello,
> I found that System.currentTimeMillis() can be used instead of new Date.getTime().
> Since new Date() is a thin wrapper of light method System.currentTimeMillis(). The performance will be greatly damaged if it is invoked too much times.
> According to my local testing at the same environment, System.currentTimeMillis() can achieve a speedup to 5 times (435 ms vs 2073 ms), when these two methods are invoked 5,000,000 times.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)