Home
last modified time | relevance | path

Searched refs:nanos (Results 1 – 25 of 44) sorted by relevance

12

/libcore/ojluni/src/main/java/java/time/
DDuration.java160 private final int nanos; field in Duration
274 public static Duration ofNanos(long nanos) { in ofNanos() argument
275 long secs = nanos / NANOS_PER_SECOND; in ofNanos()
276 int nos = (int) (nanos % NANOS_PER_SECOND); in ofNanos()
399 int nanos = parseFraction(text, fractionMatch, seconds < 0 ? -1 : 1); in parse() local
401 return create(negate, daysAsSecs, hoursAsSecs, minsAsSecs, seconds, nanos); in parse()
437 … create(boolean negate, long daysAsSecs, long hoursAsSecs, long minsAsSecs, long secs, int nanos) { in create() argument
440 return ofSeconds(seconds, nanos).negated(); in create()
442 return ofSeconds(seconds, nanos); in create()
472 long nanos; in between()
[all …]
DInstant.java252 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 …]
DLocalDateTime.java1333 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/
DTimestamp.java93 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/
DSystemTest.java46 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/test/java/util/concurrent/tck/
DSystemTest.java70 long nanos = n2 - n1; in testNanoTime1() local
71 assertTrue(nanos >= 0); in testNanoTime1()
72 long nanosAsMillis = nanos / 1000000; in testNanoTime1()
90 long nanos = n2 - n1; in testNanoTime2() local
92 assertTrue(nanos >= 0); in testNanoTime2()
93 long nanosAsMillis = nanos / 1000000; in testNanoTime2()
/libcore/ojluni/src/main/java/java/util/concurrent/locks/
DLockSupport.java226 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/nio/file/attribute/
DFileTime.java150 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/
DCyclicBarrier.java199 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()
DDelayQueue.java254 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()
DSynchronousQueue.java186 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 …]
DAbstractExecutorService.java148 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()
DLinkedBlockingDeque.java410 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 …]
DPhaser.java784 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()
DFutureTask.java395 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()
DScheduledThreadPoolExecutor.java1149 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()
DLinkedBlockingQueue.java376 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()
/libcore/ojluni/src/test/java/time/tck/java/time/
DTCKInstant.java691 …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 …]
/libcore/ojluni/annotations/hiddenapi/java/time/
DDuration.java73 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/
DChronoLocalDateTimeImpl.java337 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/sdk/nullability/java/lang/
DObject.annotated.java52 public final native void wait(long timeout, int nanos) throws java.lang.InterruptedException; in wait() argument
/libcore/ojluni/annotations/hiddenapi/java/lang/
DThread.java99 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
DObject.java75 public final native void wait(long timeout, int nanos) throws java.lang.InterruptedException; in wait() argument
/libcore/luni/src/test/java/libcore/java/lang/
DThreadTest.java460 long nanos; field in ThreadTest.LongParker
463 LongParker(long nanos) { in LongParker() argument
464 this.nanos = nanos; in LongParker()
468 LockSupport.parkNanos(nanos); in LongParker()
/libcore/ojluni/src/main/java/java/lang/
DObject.java527 public final native void wait(long timeout, int nanos) throws InterruptedException; in wait() argument

12