Great info

This works great if we know in advance the time duration we want to pause the code, and the parts of the code which can be broken apart.

I am wondering if this code can be modified so that the pause can be user-controlled?
e.g. Say I have a PauseButton and ContinueButton on the form that pauses and unpauses some long running task?