/libcore/ojluni/src/main/java/java/time/ |
D | Duration.java | 158 private final int nanos; field in Duration 272 public static Duration ofNanos(long nanos) { in ofNanos() argument 273 long secs = nanos / NANOS_PER_SECOND; in ofNanos() 274 int nos = (int) (nanos % NANOS_PER_SECOND); in ofNanos() 397 int nanos = parseFraction(text, fractionMatch, seconds < 0 ? -1 : 1); in parse() local 399 return create(negate, daysAsSecs, hoursAsSecs, minsAsSecs, seconds, nanos); in parse() 435 … create(boolean negate, long daysAsSecs, long hoursAsSecs, long minsAsSecs, long secs, int nanos) { in create() argument 438 return ofSeconds(seconds, nanos).negated(); in create() 440 return ofSeconds(seconds, nanos); in create() 470 long nanos; in between() [all …]
|
D | Instant.java | 252 private final int nanos; field in Instant 417 private Instant(long epochSecond, int nanos) { in Instant() argument 420 this.nanos = nanos; in Instant() 555 case NANO_OF_SECOND: return nanos; in get() 556 case MICRO_OF_SECOND: return nanos / 1000; in get() 557 case MILLI_OF_SECOND: return nanos / 1000_000; in get() 592 case NANO_OF_SECOND: return nanos; in getLong() 593 case MICRO_OF_SECOND: return nanos / 1000; in getLong() 594 case MILLI_OF_SECOND: return nanos / 1000_000; in getLong() 626 return nanos; in getNano() [all …]
|
D | LocalDateTime.java | 1333 public LocalDateTime plusNanos(long nanos) { in plusNanos() argument 1334 return plusWithOverflow(date, 0, 0, 0, nanos, 1); in plusNanos() 1528 public LocalDateTime minusNanos(long nanos) { in minusNanos() argument 1529 return plusWithOverflow(date, 0, 0, 0, nanos, -1); in minusNanos() 1546 …plusWithOverflow(LocalDate newDate, long hours, long minutes, long seconds, long nanos, int sign) { in plusWithOverflow() argument 1548 if ((hours | minutes | seconds | nanos) == 0) { in plusWithOverflow() 1551 long totDays = nanos / NANOS_PER_DAY + // max/24*60*60*1B in plusWithOverflow() 1556 long totNanos = nanos % NANOS_PER_DAY + // max 86400000000000 in plusWithOverflow()
|
/libcore/ojluni/src/main/java/java/sql/ |
D | Timestamp.java | 93 nanos = nano; in Timestamp() 110 nanos = (int)((time%1000) * 1000000); in Timestamp() 111 if (nanos < 0) { in Timestamp() 112 nanos = 1000000000 + nanos; in Timestamp() 128 nanos = (int)((time%1000) * 1000000); in setTime() 129 if (nanos < 0) { in setTime() 130 nanos = 1000000000 + nanos; in setTime() 145 return (time + (nanos / 1000000)); in getTime() 152 private int nanos; field in Timestamp 326 if (nanos == 0) { in toString() [all …]
|
/libcore/jsr166-tests/src/test/java/jsr166/ |
D | SystemTest.java | 46 long nanos = n2 - n1; in testNanoTime1() local 47 assertTrue(nanos >= 0); in testNanoTime1() 48 long nanosAsMillis = nanos / 1000000; in testNanoTime1() 66 long nanos = n2 - n1; in testNanoTime2() local 68 assertTrue(nanos >= 0); in testNanoTime2() 69 long nanosAsMillis = nanos / 1000000; in testNanoTime2()
|
/libcore/ojluni/src/main/java/java/nio/file/attribute/ |
D | FileTime.java | 150 long nanos = unit.convert(instant.getNano(), TimeUnit.NANOSECONDS); in to() local 151 long r = secs + nanos; in to() 153 if (((secs ^ r) & (nanos ^ r)) < 0) { in to() 174 int nanos = instant.getNano(); in toMillis() local 183 return r + nanos / 1000_000; in toMillis() 233 int nanos = 0; in toInstant() local 252 nanos = (int)Math.floorMod(value, MILLIS_PER_SECOND) in toInstant() 257 nanos = (int)Math.floorMod(value, MICROS_PER_SECOND) in toInstant() 262 nanos = (int)Math.floorMod(value, NANOS_PER_SECOND); in toInstant() 271 instant = Instant.ofEpochSecond(secs, nanos); in toInstant() [all …]
|
/libcore/ojluni/src/main/java/java/util/concurrent/locks/ |
D | LockSupport.java | 226 public static void parkNanos(Object blocker, long nanos) { in parkNanos() argument 227 if (nanos > 0) { in parkNanos() 230 U.park(false, nanos); in parkNanos() 351 public static void parkNanos(long nanos) { in parkNanos() argument 352 if (nanos > 0) in parkNanos() 353 U.park(false, nanos); in parkNanos()
|
/libcore/ojluni/src/main/java/java/util/concurrent/ |
D | CyclicBarrier.java | 199 private int dowait(boolean timed, long nanos) in dowait() argument 236 else if (nanos > 0L) in dowait() 237 nanos = trip.awaitNanos(nanos); in dowait() 256 if (timed && nanos <= 0L) { in dowait()
|
D | SynchronousQueue.java | 186 abstract E transfer(E e, boolean timed, long nanos); in transfer() argument 328 E transfer(E e, boolean timed, long nanos) { in transfer() argument 356 if (timed && nanos <= 0L) { // can't wait in transfer() 362 SNode m = awaitFulfill(s, timed, nanos); in transfer() 413 SNode awaitFulfill(SNode s, boolean timed, long nanos) { in awaitFulfill() argument 436 final long deadline = timed ? System.nanoTime() + nanos : 0L; in awaitFulfill() 448 nanos = deadline - System.nanoTime(); in awaitFulfill() 449 if (nanos <= 0L) { in awaitFulfill() 460 else if (nanos > SPIN_FOR_TIMEOUT_THRESHOLD) in awaitFulfill() 461 LockSupport.parkNanos(this, nanos); in awaitFulfill() [all …]
|
D | DelayQueue.java | 254 long nanos = unit.toNanos(timeout); in poll() local 261 if (nanos <= 0L) in poll() 264 nanos = available.awaitNanos(nanos); in poll() 269 if (nanos <= 0L) in poll() 272 if (nanos < delay || leader != null) in poll() 273 nanos = available.awaitNanos(nanos); in poll() 279 nanos -= delay - timeLeft; in poll()
|
D | AbstractExecutorService.java | 148 boolean timed, long nanos) in doInvokeAny() argument 169 final long deadline = timed ? System.nanoTime() + nanos : 0L; in doInvokeAny() 188 f = ecs.poll(nanos, NANOSECONDS); in doInvokeAny() 191 nanos = deadline - System.nanoTime(); in doInvokeAny() 264 final long nanos = unit.toNanos(timeout); in invokeAll() local 265 final long deadline = System.nanoTime() + nanos; in invokeAll() 277 if (((i == 0) ? nanos : deadline - System.nanoTime()) <= 0L) in invokeAll()
|
D | LinkedBlockingDeque.java | 410 long nanos = unit.toNanos(timeout); in offerFirst() local 415 if (nanos <= 0L) in offerFirst() 417 nanos = notFull.awaitNanos(nanos); in offerFirst() 433 long nanos = unit.toNanos(timeout); in offerLast() local 438 if (nanos <= 0L) in offerLast() 440 nanos = notFull.awaitNanos(nanos); in offerLast() 514 long nanos = unit.toNanos(timeout); in pollFirst() local 520 if (nanos <= 0L) in pollFirst() 522 nanos = notEmpty.awaitNanos(nanos); in pollFirst() 532 long nanos = unit.toNanos(timeout); in pollLast() local [all …]
|
D | Phaser.java | 784 long nanos = unit.toNanos(timeout); in awaitAdvanceInterruptibly() local 791 QNode node = new QNode(this, phase, true, true, nanos); in awaitAdvanceInterruptibly() 1090 long nanos; field in Phaser.QNode 1096 boolean timed, long nanos) { in QNode() argument 1100 this.nanos = nanos; in QNode() 1102 this.deadline = timed ? System.nanoTime() + nanos : 0L; in QNode() 1120 (nanos <= 0L || (nanos = deadline - System.nanoTime()) <= 0L)) { in isReleasable() 1130 LockSupport.parkNanos(this, nanos); in block()
|
D | FutureTask.java | 395 private int awaitDone(boolean timed, long nanos) in awaitDone() argument 423 if (timed && nanos <= 0L) in awaitDone() 436 parkNanos = nanos; in awaitDone() 439 if (elapsed >= nanos) { in awaitDone() 443 parkNanos = nanos - elapsed; in awaitDone()
|
D | ScheduledThreadPoolExecutor.java | 1149 long nanos = unit.toNanos(timeout); in poll() local 1156 if (nanos <= 0L) in poll() 1159 nanos = available.awaitNanos(nanos); in poll() 1164 if (nanos <= 0L) in poll() 1167 if (nanos < delay || leader != null) in poll() 1168 nanos = available.awaitNanos(nanos); in poll() 1174 nanos -= delay - timeLeft; in poll()
|
D | LinkedBlockingQueue.java | 376 long nanos = unit.toNanos(timeout); in offer() local 383 if (nanos <= 0L) in offer() 385 nanos = notFull.awaitNanos(nanos); in offer() 459 long nanos = unit.toNanos(timeout); in poll() local 465 if (nanos <= 0L) in poll() 467 nanos = notEmpty.awaitNanos(nanos); in poll()
|
D | ArrayBlockingQueue.java | 356 long nanos = unit.toNanos(timeout); in offer() local 361 if (nanos <= 0L) in offer() 363 nanos = notFull.awaitNanos(nanos); in offer() 395 long nanos = unit.toNanos(timeout); in poll() local 400 if (nanos <= 0L) in poll() 402 nanos = notEmpty.awaitNanos(nanos); in poll()
|
/libcore/ojluni/src/main/java/java/lang/ |
D | Thread.java | 362 private static native void sleep(Object lock, long millis, int nanos) in sleep() argument 388 public static void sleep(long millis, int nanos) in sleep() argument 404 if (nanos < 0) { in sleep() 405 throw new IllegalArgumentException("nanos < 0: " + nanos); in sleep() 407 if (nanos > 999999) { in sleep() 408 throw new IllegalArgumentException("nanos > 999999: " + nanos); in sleep() 424 if (millis == 0 && nanos == 0) { in sleep() 438 durationNanos = (millis * nanosPerMilli) + nanos; in sleep() 452 nanos = (int) (remaining % nanosPerMilli); in sleep() 453 sleep(lock, millis, nanos); in sleep() [all …]
|
/libcore/ojluni/src/test/java/time/tck/java/time/ |
D | TCKDuration.java | 1089 …public void plus(long seconds, int nanos, long otherSeconds, int otherNanos, long expectedSeconds,… in plus() argument 1090 …Duration t = Duration.ofSeconds(seconds, nanos).plus(Duration.ofSeconds(otherSeconds, otherNanos)); in plus() 1300 …public void plusSeconds_long(long seconds, int nanos, long amount, long expectedSeconds, int expec… in plusSeconds_long() argument 1301 Duration t = Duration.ofSeconds(seconds, nanos); in plusSeconds_long() 1376 …public void plusMillis_long(long seconds, int nanos, long amount, long expectedSeconds, int expect… in plusMillis_long() argument 1377 Duration t = Duration.ofSeconds(seconds, nanos); in plusMillis_long() 1383 …public void plusMillis_long_oneMore(long seconds, int nanos, long amount, long expectedSeconds, in… in plusMillis_long_oneMore() argument 1384 Duration t = Duration.ofSeconds(seconds + 1, nanos); in plusMillis_long_oneMore() 1390 …public void plusMillis_long_minusOneLess(long seconds, int nanos, long amount, long expectedSecond… in plusMillis_long_minusOneLess() argument 1391 Duration t = Duration.ofSeconds(seconds - 1, nanos); in plusMillis_long_minusOneLess() [all …]
|
D | TCKInstant.java | 691 …ic void test_plusTemporalAmount(TemporalUnit unit, TemporalAmount amount, int seconds, int nanos) { 694 Instant expected = Instant.ofEpochSecond(seconds, nanos); 915 …public void plus_Duration(long seconds, int nanos, long otherSeconds, int otherNanos, long expecte… 916 …Instant i = Instant.ofEpochSecond(seconds, nanos).plus(Duration.ofSeconds(otherSeconds, otherNanos… 935 …public void plus_longTemporalUnit(long seconds, int nanos, long otherSeconds, int otherNanos, long… 936 …Instant i = Instant.ofEpochSecond(seconds, nanos).plus(otherSeconds, SECONDS).plus(otherNanos, NAN… 985 …public void plusSeconds_long(long seconds, int nanos, long amount, long expectedSeconds, int expec… 986 Instant t = Instant.ofEpochSecond(seconds, nanos); 1064 …public void plusMillis_long(long seconds, int nanos, long amount, long expectedSeconds, int expect… 1065 Instant t = Instant.ofEpochSecond(seconds, nanos); [all …]
|
D | TCKLocalTime.java | 1710 int nanos = 0; in test_plusNanos_halfABillion() local 1713 nanos += 500000000; in test_plusNanos_halfABillion() 1714 if (nanos == 1000000000) { in test_plusNanos_halfABillion() 1716 nanos = 0; in test_plusNanos_halfABillion() 1729 assertEquals(t.getNano(), nanos); in test_plusNanos_halfABillion() local 1741 long nanos = 0; in plusNanos_fromZero() local 1748 final Object[] ret = new Object[] {i, hour, min, sec, (int)nanos}; in plusNanos_fromZero() 1750 nanos += delta; in plusNanos_fromZero() 1752 if (nanos >= 1000000000L) { in plusNanos_fromZero() 1753 sec += nanos / 1000000000L; in plusNanos_fromZero() [all …]
|
/libcore/ojluni/src/test/java/nio/file/attribute/ |
D | FileTimeTest.java | 170 long nanos = v; in main() local 171 ft = FileTime.from(nanos, NANOSECONDS); in main() 172 secs = nanos / 1000_000_000; in main() 173 nanos = nanos % 1000_000_000; in main() 174 instant = Instant.ofEpochSecond(secs, nanos); in main() 297 long nanos = NANOSECONDS.convert(value - unit.convert(secs, SECONDS), unit); in eqTime() local 298 if (nanos < 0) { // normalize nanoOfSecond to positive in eqTime() 300 nanos += 1000_000_000; in eqTime() 302 if (secs != instant.getEpochSecond() || (int)nanos != instant.getNano()) { in eqTime()
|
/libcore/ojluni/annotations/hiddenapi/java/time/ |
D | Duration.java | 73 private Duration(long seconds, int nanos) { in Duration() argument 101 public static java.time.Duration ofNanos(long nanos) { in ofNanos() argument 136 int nanos) { in create() argument 352 private final int nanos; field in Duration 355 nanos = 0;
|
/libcore/ojluni/src/main/java/java/time/chrono/ |
D | ChronoLocalDateTimeImpl.java | 337 private ChronoLocalDateTimeImpl<D> plusNanos(long nanos) { in plusNanos() argument 338 return plusWithOverflow(date, 0, 0, 0, nanos); in plusNanos() 342 …alDateTimeImpl<D> plusWithOverflow(D newDate, long hours, long minutes, long seconds, long nanos) { in plusWithOverflow() argument 344 if ((hours | minutes | seconds | nanos) == 0) { in plusWithOverflow() 347 long totDays = nanos / NANOS_PER_DAY + // max/24*60*60*1B in plusWithOverflow() 351 long totNanos = nanos % NANOS_PER_DAY + // max 86400000000000 in plusWithOverflow()
|
/libcore/ojluni/annotations/hiddenapi/java/lang/ |
D | Thread.java | 99 private static native void sleep(java.lang.Object lock, long millis, int nanos) in sleep() argument 102 public static void sleep(long millis, int nanos) throws java.lang.InterruptedException { in sleep() argument 219 public final void join(long millis, int nanos) throws java.lang.InterruptedException { in join() argument 334 public final void parkFor$(long nanos) { in parkFor$() argument
|