How to get a delay with break?

I need a delay with break for many purposes, i want to know how its done. What i mean by delay with break is a way to stop a delay whenever. I dont want to restart the delay, just stop it from outputting.

Hi, it would be a good idea to use a Timer (without looping) for this purpose. You can then get the timer handle and pause/unpause or stop the timer at any point.

On the other hand, with delays, you can’t break it. So you’d need a conditional check after the delay to make sure that whatever follows don’t execute if you decide to break the delay.

Thanks a million!