public final class AutoThrottles extends Object
AutoThrottle creation.| Modifier and Type | Method and Description |
|---|---|
static AutoThrottle |
alwaysThrottle()
Printout always requested.
|
static AutoThrottle |
create(long delay,
boolean first)
Create a timing throttle.
|
static AutoThrottle |
createWithInitialDelay(Supplier<Long> currentTime,
long initialDelay,
long targetDelay)
Create with different initial delay.
|
static Supplier<Long> |
currentTimeMillisSupplier()
Returns
System.currentTimeMillis(). |
static AutoThrottle |
noThrottle()
No printout requested.
|
public static AutoThrottle noThrottle()
public static AutoThrottle alwaysThrottle()
public static AutoThrottle create(long delay, boolean first)
delay - Target delay between printouts in msfirst - Request printout on the first invocationpublic static AutoThrottle createWithInitialDelay(Supplier<Long> currentTime, long initialDelay, long targetDelay)
currentTime - Time sourceinitialDelay - Initial delay of the first printouttargetDelay - Target delay between further printoutspublic static Supplier<Long> currentTimeMillisSupplier()
System.currentTimeMillis().