You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Ahmet Arslan (JIRA)" <ji...@apache.org> on 2016/02/04 19:52:39 UTC
[jira] [Created] (LUCENE-7014) Use TimeUnit.TARGETUNIT.convert() to
convert between time units
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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org