use of org.activityinfo.legacy.shared.util.ExponentialBackOff in project activityinfo by bedatadriven.
the class ExponentialBackOffTest method test.
@Test
public void test() throws IOException {
NanoClock nanoClock = new NanoClock() {
@Override
public long nanoTime() {
return System.nanoTime();
}
};
ExponentialBackOff defaultBackOff = new ExponentialBackOff.Builder().setNanoClock(nanoClock).build();
ExponentialBackOff backOff = new ExponentialBackOff.Builder().setInitialIntervalMillis(TimeUnit.SECONDS.toMillis(10)).setMultiplier(// increase in 3 times
2).setNanoClock(nanoClock).build();
for (int i = 0; i < 10; i++) {
System.out.println(defaultBackOff.nextBackOffMillis() + " " + backOff.nextBackOffMillis());
}
}
Aggregations