debouncing a switch during 'while' loop

Could be worse:

delay (10000);