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

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

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      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.
      >>

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: