End mid loop() @ sensor input, how?

Thank you all! I'm new to this and haven't rly looked in to millis() yet. I honestly had no clue you could use it that way, now I know what to do the rest of the evening ^^

I've gone through several books but most of them centers around given projects and don't rly get in to the more general code usage.

The book (PDF: Beginning Arduino Programming by Brian Evans ((free download)) ) I'm on right now is the first1 i've read that actually takes time to explain the code in a broader perspective.

On chapter 5 so far so haven't gotten to millis() yet. I'll skip ahead and see if it makes me any wiser.

Thx again for fast replys on (what I guess is) noob questions. Hopefully I can post my current project here soon. With working code ^^