How to stop/do something if analog value has not changed in a certain amount of time

I'm a total newbie. Would you please explain this?