Pump timer programming

I've got a pump that arduino turns on for five minutes. During this run time, I would like to check to see if a "cut-off" switch opens that would interrupt the timer and shut off the pump. Is there a way to do this as the timer runs? Or should my sketch consist of multiple mini delays, checking the cut-off switch during each mini period?

Is there a way to do this as the timer runs?

What timer?

Or should my sketch consist of multiple mini delays

No. It should have NO delay()s. Look, if necessary, at the blink without delay example. Understand and embrace the philosophy that that example demonstrates.

I have seen the light, ah, blink!

Thanks, it made a lot of sense once I looked at the example and read about millis().

It sucks being a beginner.

thanks!