Function waitForCondition

Waits for the specified condition to be satisfied (or for the checker to be stopped or to timeout)