Home
last modified time | relevance | path

Searched refs:duration (Results 1 – 25 of 26) sorted by relevance

12

/libcore/luni/src/test/java/libcore/javax/xml/datatype/
DDatatypeFactoryTest.java45 Duration duration = factory.newDuration(true, 1, 2, 3, 4, 5, 6); in testNewDuration_biiiiii() local
46 assertEquals(1, duration.getYears()); in testNewDuration_biiiiii()
47 assertEquals(2, duration.getMonths()); in testNewDuration_biiiiii()
48 assertEquals(3, duration.getDays()); in testNewDuration_biiiiii()
49 assertEquals(4, duration.getHours()); in testNewDuration_biiiiii()
50 assertEquals(5, duration.getMinutes()); in testNewDuration_biiiiii()
51 assertEquals(6, duration.getSeconds()); in testNewDuration_biiiiii()
55 Duration duration = factory.newDurationDayTime(true, 3, 4, 5, 6); in testNewDurationDayTime_biiii() local
56 assertEquals(0, duration.getYears()); in testNewDurationDayTime_biiii()
57 assertEquals(0, duration.getMonths()); in testNewDurationDayTime_biiii()
[all …]
DDurationImpl.java118 public int compare(Duration duration) { in compare() argument
DXMLGregorianCalendarTest.java328 public void add(Duration duration) {} in add() argument
/libcore/ojluni/src/main/java/java/util/concurrent/
DTimeUnit.java217 public long convert(Duration duration) { in convert() argument
218 long secs = duration.getSeconds(); in convert()
219 int nano = duration.getNano(); in convert()
251 public long toNanos(long duration) { in toNanos() argument
254 return duration; in toNanos()
255 else if (duration > (m = maxNanos)) in toNanos()
257 else if (duration < -m) in toNanos()
260 return duration * s; in toNanos()
271 public long toMicros(long duration) { in toMicros() argument
274 return (s == MICRO_SCALE) ? duration : duration / microRatio; in toMicros()
[all …]
/libcore/ojluni/src/test/java/time/test/java/time/
DTestInstantSource.java65 var duration = Duration.ofSeconds(1);
66 var test = InstantSource.tick(InstantSource.fixed(instant), duration);
67 …tEquals(test.withZone(ZoneOffset.UTC), Clock.tick(Clock.fixed(instant, ZoneOffset.UTC), duration));
68 assertEquals(test.withZone(PARIS), Clock.tick(Clock.fixed(instant, PARIS), duration));
71 assertEquals(test, InstantSource.tick(InstantSource.fixed(instant), duration));
72 …assertEquals(test.hashCode(), InstantSource.tick(InstantSource.fixed(instant), duration).hashCode(…
90 var duration = Duration.ofSeconds(120);
91 var test = InstantSource.offset(InstantSource.fixed(instant), duration);
92 …quals(test.withZone(ZoneOffset.UTC), Clock.offset(Clock.fixed(instant, ZoneOffset.UTC), duration));
93 assertEquals(test.withZone(PARIS), Clock.offset(Clock.fixed(instant, PARIS), duration));
[all …]
/libcore/luni/src/main/java/javax/xml/datatype/
DDuration.java762 public abstract int compare(final Duration duration); in compare() argument
790 public boolean isLongerThan(final Duration duration) { in isLongerThan() argument
791 return compare(duration) == DatatypeConstants.GREATER; in isLongerThan()
812 public boolean isShorterThan(final Duration duration) { in isShorterThan() argument
813 return compare(duration) == DatatypeConstants.LESSER; in isShorterThan()
853 public boolean equals(final Object duration) { in equals() argument
854 if (duration == this) { in equals()
857 if (duration instanceof Duration) { in equals()
858 return compare((Duration) duration) == DatatypeConstants.EQUAL; in equals()
DXMLGregorianCalendar.java866 public abstract void add(Duration duration); in add() argument
/libcore/luni/src/test/java/libcore/java/time/
DDurationTest.java89 Duration duration = (Duration) values[1]; in test_addTo_exceeds() local
92 duration.addTo(temporal); in test_addTo_exceeds()
93 fail(" Should have failed to add " + duration + " to " + temporal); in test_addTo_exceeds()
117 Duration duration = (Duration) values[1]; in test_subtractFrom_exceeds() local
120 duration.subtractFrom(temporal); in test_subtractFrom_exceeds()
121 fail("Should have failed to subtract " + duration + " from " + temporal); in test_subtractFrom_exceeds()
/libcore/ojluni/src/test/java/nio/channels/Selector/
DSelectWithConsumer.java312 long duration = System.currentTimeMillis() - start; in testTimeout() local
314 assertTrue(duration > 500, "select took " + duration + " ms"); in testTimeout()
336 long duration = System.currentTimeMillis() - start; in testWakeupBeforeSelect() local
338 assertTrue(duration < 5000, "select took " + duration + " ms"); in testWakeupBeforeSelect()
359 long duration = System.currentTimeMillis() - start; in try() local
361 assertTrue(duration > 500 && duration < 10*1000, in try()
362 "select took " + duration + " ms"); in try()
386 long duration = System.currentTimeMillis() - start; in testInterruptBeforeSelect() local
388 assertTrue(duration < 5000, "select took " + duration + " ms"); in testInterruptBeforeSelect()
416 long duration = System.currentTimeMillis() - start; in try() local
[all …]
/libcore/ojluni/src/main/java/java/time/temporal/
DChronoUnit.java193 private final Duration duration; field in ChronoUnit
197 this.duration = estimatedDuration; in ChronoUnit()
211 return duration; in getDuration()
DIsoFields.java681 private final Duration duration; field in IsoFields.Unit
685 this.duration = estimatedDuration; in Unit()
690 return duration; in getDuration()
/libcore/ojluni/src/main/java/java/time/
DDuration.java331 Duration duration = ZERO; in from() local
333 duration = duration.plus(amount.get(unit), unit); in from()
335 return duration; in from()
672 public Duration plus(Duration duration) { in plus() argument
673 return plus(duration.getSeconds(), duration.getNano()); in plus()
712 Duration duration = unit.getDuration().multipliedBy(amountToAdd); in plus() local
713 return plusSeconds(duration.getSeconds()).plusNanos(duration.getNano()); in plus()
829 public Duration minus(Duration duration) { in minus() argument
830 long secsToSubtract = duration.getSeconds(); in minus()
831 int nanosToSubtract = duration.getNano(); in minus()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/org/apache/harmony/kernel/dalvik/
DThreadsTest.java262 long duration = getDurationMillis(waitMillis); in assertDurationIsInRange() local
264 if (duration < minimum) { in assertDurationIsInRange()
267 " actual duration too short: " + duration); in assertDurationIsInRange()
268 } else if (duration > maximum) { in assertDurationIsInRange()
271 " actual duration too long: " + duration); in assertDurationIsInRange()
/libcore/luni/src/main/java/libcore/icu/
DTimeZoneNames.java66 long duration = TimeUnit.NANOSECONDS.toMillis(end - start); in create() local
67 System.logI("Loaded time zone names for \"" + locale + "\" in " + duration + "ms" + in create()
/libcore/ojluni/src/test/java/util/GregorianCalendar/
DGregorianCalendarTest.java45 int duration = 600; in testGregorianCalendar() local
177 for (int i = 0; getCounter() > 0 && i < duration; i++) { in testGregorianCalendar()
/libcore/ojluni/annotations/hiddenapi/java/time/
DDuration.java181 public java.time.Duration plus(java.time.Duration duration) { in plus() argument
217 public java.time.Duration minus(java.time.Duration duration) { in minus() argument
/libcore/luni/src/main/java/libcore/io/
DForwardingOs.java884 …ublic void tcsendbreak(FileDescriptor fd, int duration) throws ErrnoException { os.tcsendbreak(fd,… in tcsendbreak() argument
DOs.java739 public void tcsendbreak(FileDescriptor fd, int duration) throws ErrnoException; in tcsendbreak() argument
DLinux.java270 public native void tcsendbreak(FileDescriptor fd, int duration) throws ErrnoException; in tcsendbreak() argument
/libcore/luni/src/main/java/android/system/
DOs.java939 …c void tcsendbreak(FileDescriptor fd, int duration) throws ErrnoException { Libcore.os.tcsendbreak… in tcsendbreak() argument
/libcore/ojluni/src/test/java/time/tck/java/time/
DTCKZonedDateTime.java1644 Duration duration = Duration.ofSeconds(4L * 60 * 60 + 5L * 60 + 6L);
1647 assertEquals(t.plus(duration), expected);
1849 Duration duration = Duration.ofSeconds(4L * 60 * 60 + 5L * 60 + 6L);
1852 assertEquals(t.minus(duration), expected);
DTCKDuration.java3079 Duration duration = Duration.ofSeconds(5000, 1000); in test_duration_getUnits() local
3080 List<TemporalUnit> units = duration.getUnits(); in test_duration_getUnits()
/libcore/ojluni/src/main/java/java/time/format/
DDateTimeFormatterBuilder.java5303 …ic final Comparator<DayPeriod> DPCOMPARATOR = (dp1, dp2) -> (int)(dp1.duration() - dp2.duration());
5350 return (from + duration() / 2) % 1_440; in mid()
5374 private long duration() { in duration() method
/libcore/benchmarks/src/benchmarks/regression/
DR.java1565 public static final int duration = 0; field in R
/libcore/luni/src/main/native/
Dlibcore_io_Linux.cpp2703 static void Linux_tcsendbreak(JNIEnv* env, jobject, jobject javaFd, jint duration) { in Linux_tcsendbreak() argument
2705 throwIfMinusOne(env, "tcsendbreak", TEMP_FAILURE_RETRY(tcsendbreak(fd, duration))); in Linux_tcsendbreak()

12