Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8071919

Add java.time.Clock.tickMillis(ZoneId zone) method

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 9
    • 9
    • core-libs
    • b94

    Description

      With the increased resolution brought up by JDK-8068730, it would feel more natural to add a new java.time.Clock.tickMillis(ZoneId zone) method to java.time.Clock - which would return a clock with only milliseconds resolution.

      Quoting from Stephen Colebourne:

      <<
      I do believe that this change means that a new method should be added
      to Clock however:

          public static Clock tickMillis(ZoneId zone) {
              return new TickClock(system(zone), NANOS_PER_MILLI);
          }

      While this can be achieved without a new method, the API would feel
      slightly strange without it now better-than-milli clocks exist. I
      recommend raising a separate RFE to track this.
      >>

      Attachments

        Issue Links

          Activity

            People

              ntv Nadeesh Tv
              dfuchs Daniel Fuchs
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: