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

(spec) Defect in the System.nanoTime spec

    Details

    • Subcomponent:
    • Resolved In Build:
      b49

      Backports

        Description

        Spec of the System.nanoTime:
        "To compare two nanoTime values
         long t0 = System.nanoTime();
         ...
         long t1 = System.nanoTime();
        one should use t1 - t0 < 0, not t1 < t0, because of the possibility of numerical overflow."

        Looks like "t1 - t0 < 0, not t1 < t0" would be better to replace with "t0 - t1 < 0, not t0 < t1", because t0 is less then t1.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  bpb Brian Burkhalter
                  Reporter:
                  evotchen Elena Votchennikova (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: