help with servo project !

the servo itself stops moving.

im refering to the actual display that i have showing in the monitor.

the display shows 0 and when i push the button it goes through the whole 0-180 and then 180-0, whether or not the servo is actually moving.

So I can push the button for two seconds and then the servo stops, but the monitor still displays the 0-180 and back again. i am trying to find a way to freeze the display whenever the actual servo stops moving.

I guess what I want, is a way to interupt the code as soon as the button is released.

is that possible?