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