While

constructor(condition: BooleanSupplier, runThis: Runnable, callback: Runnable, timeout: Measure<Time>)

Parameters

condition

The condition or function to evaluate as an exit. Return false to exit the loop.

runThis

The function to run on each loop iteration.

callback

The callback to run once [condition] is met.

timeout

Optional timeout. If the timeout is reached, the loop will exit.