use of com.oath.cyclops.util.SimpleTimer in project cyclops by aol.
the class AbstractIterableXTest method fixedDelay.
@Test
public void fixedDelay() {
SimpleTimer timer = new SimpleTimer();
assertThat(of(1, 2, 3, 4, 5, 6).fixedDelay(10000, TimeUnit.NANOSECONDS).collect(Collectors.toList()).size(), is(6));
assertThat(timer.getElapsedNanoseconds(), greaterThan(60000l));
}
use of com.oath.cyclops.util.SimpleTimer in project cyclops by aol.
the class AbstractIterableXTest method onePer.
@Test
public void onePer() {
SimpleTimer timer = new SimpleTimer();
System.out.println(of(1, 2, 3, 4, 5, 6).onePer(1000, TimeUnit.NANOSECONDS).collect(Collectors.toList()));
assertThat(of(1, 2, 3, 4, 5, 6).onePer(1000, TimeUnit.NANOSECONDS).collect(Collectors.toList()).size(), is(6));
assertThat(timer.getElapsedNanoseconds(), greaterThan(600l));
}
use of com.oath.cyclops.util.SimpleTimer in project cyclops by aol.
the class BatchingRSTest method judder.
@Test
public void judder() {
SimpleTimer timer = new SimpleTimer();
assertThat(of(1, 2, 3, 4, 5, 6).jitter(10000).to(Streamable::fromStream).collect(Collectors.toList()).size(), is(6));
assertThat(timer.getElapsedNanoseconds(), greaterThan(20000l));
}
use of com.oath.cyclops.util.SimpleTimer in project cyclops by aol.
the class BatchingRSTest method xPer.
@Test
public void xPer() {
SimpleTimer timer = new SimpleTimer();
assertThat(of(1, 2, 3, 4, 5, 6).xPer(6, 100000000, TimeUnit.NANOSECONDS).to(Streamable::fromStream).collect(Collectors.toList()).size(), is(6));
assertThat(timer.getElapsedNanoseconds(), lessThan(60000000l));
}
use of com.oath.cyclops.util.SimpleTimer in project cyclops by aol.
the class BatchingRSTest method fixedDelay.
@Test
public void fixedDelay() {
SimpleTimer timer = new SimpleTimer();
assertThat(of(1, 2, 3, 4, 5, 6).fixedDelay(10000, TimeUnit.NANOSECONDS).to(Streamable::fromStream).collect(Collectors.toList()).size(), is(6));
assertThat(timer.getElapsedNanoseconds(), greaterThan(60000l));
}
Aggregations