Random r = new Random(2222);
// Random numbers are between zero and the constant, so everything will average out
// to half the time and quantities. Nothing will be exhausted by the test.
final int loopCount = (DURATION_SECONDS * 1000) / (INVOCATION_SLEEP_MILLIS + IDLE_SLEEP_MILLIS);
for (int i = 0; i < loopCount; i++) {
bps.logBalanceStarts();
int invocationTimeMS = r.nextInt(INVOCATION_SLEEP_MILLIS);
Thread.sleep(invocationTimeMS);
checker.totalInvTimeMS += invocationTimeMS;
int ranges = r.nextInt(RANGES_TO_MOVE / loopCount);
int bytes = r.nextInt(BYTES_TO_MOVE / loopCount);