So I'm coding a carwash and I need to check many conditions to make sure there's no problem. So my idea is to use millis() so I never block my code. I know how to use millis() to make an event happen every given time, but my problem is: I need to check if the input is high for a given time. let's say I want to know if that button was pressed for 10 seconds and if so, something happens. My code needs to happen in the loop because these conditions need to be checked periodically. I've heard of the function pulseIn, but it is blockant. If any of you has a solution, sharing it would be greatly appreciated.