My crystal ball sees some confusion here. We have no idea what your trying to do.
Take this example. Someone pushed a button vs. Someone pushed a button when I was busy. When was the button pushed? vs. When did the peak of an analog signal occur? or just where was the 100 ns glitch?
These are very different kinds of problems.
Let's take the someone pushed a button when I was busy since I'm guessing this might be the type of signal we are talking about.
Pushing buttons has some debouncing stuff to deal with, so lets just assume, for now, that hardware gives us a nice clean 10 mS pulse and it's not the real world.
The button would be set up to generate an interrupt. An ISR (Interrupt service routine) suspends what the process was doing, sets the act that a button pushed occurred and restores the state of the processor.
Now, when the processor is finished with what it was doing, it checks to see if a button was pressed. It then deals wit that issue.