Helper function for constructing pretest loops as an expression.
Calls state.checkTime() on every iteration.
None
nothing