debounce using interrupt example
Two interrupt service routines are used to detect the switching. Each occurence increases counter. Counter content is displayed each second via serial port. One switch sets the LED at pin 13 ON the other switch sets it to OFF. Depending on type of switch, the counter is not only increased by one. The difference gives the number of bounces per switching event.
This is only to demonstrate how your switch is bouncing. The number of bounces is capured as fast as the Arduino can capture it, using interrupts. We assume some ten times slower than the processor count, thus all bounces within more than one microsecond time difference will be detected.