Ahmet Arslan created LUCENE-7014:
------------------------------------
Summary: Use TimeUnit.TARGETUNIT.convert() to convert between time
units
Key: LUCENE-7014
URL: https://issues.apache.org/jira/browse/LUCENE-7014
Project: Lucene - Core
Issue Type: Improvement
Affects Versions: 5.4.1, master
Reporter: Ahmet Arslan
Priority: Minor
Fix For: 5.5, master, 6.0
Re-phrased from [~steve_rowe]'s
[comment|https://issues.apache.org/jira/browse/LUCENE-6823?focusedCommentId=14941283&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14941283]
:
System.nanoTime(), which is guaranteed to be monotonic, is now used to recored
elapsed times. In several places, conversion from nano seconds to some target
unit (e.g. seconds, milli seconds) is performed using hard-coded conversion
constants, which is prone to mistakes.
It would be nice to use {{TimeUnit.TARGETUNIT.convert(sourceDuration,
TimeUnit.SOURCEUNIT)}} instead.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]