Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-7014

Use TimeUnit.TARGETUNIT.convert() to convert between time units

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 5.4.1, 6.0
    • 6.0
    • None
    • None
    • New

    Description

      Re-phrased from steve_rowe's comment :

      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.

      Attachments

        1. LUCENE-7014.patch
          31 kB
          Ahmet Arslan
        2. LUCENE-7014.patch
          52 kB
          Ahmet Arslan

        Activity

          People

            Unassigned Unassigned
            iorixxx Ahmet Arslan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: