Not Dropping out of While Loop using time

This one is similar:

only that in this ^ example the “scheduled” loop until a count is reached. In your case you need to save “now” in a variable (e.g. startTime) in the beginning and before the rescheduling you need to compute the passed time and if that exceeds the expected duration you don’t reschedule.

Calculating the difference can be done via