Change usages of TimeUnit.convert to TimeUnit.toXXX

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P5
    • 20
    • Affects Version/s: None
    • Component/s: core-libs
    • None
    • b03

      If target TimeUnit is known at compile time, we can use TimeUnit.toSomething method instead of TimeUnit.convert.
      E.g.

          TimeUnit.MILLISECONDS.convert(adjust, TimeUnit.NANOSECONDS);

      Could be replaced with

          TimeUnit.NANOSECONDS.toMillis(adjust);

      It's shorter and a bit faster.

            Assignee:
            Andrey Turbanov
            Reporter:
            Andrey Turbanov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: