code: public long toMillis() {
          long millis = Math.multiplyExact(seconds, 1000);
          millis = Math.addExact(millis, nanos / 1000_000);
          return millis;
      }
docs: Converts this duration to the total length in milliseconds.
  <p>
  If this duration is too large to fit in a {@code long} milliseconds, then an
  exception is thrown.
  <p>
  If this duration has greater than millisecond precision, then the conversion
  will drop any excess precision information as though the amount in nanoseconds
  was subject to integer division by one million.
  
  @return the total length of the duration in milliseconds
  @throws ArithmeticException if numeric overflow occurs