Effective software switch debouncing AVR
I use several different techniques but most rely upon having a continuous timer tick available.

Because I work mostly with PIC microcontrollers running at 4 MHz, my timer tick is 1.024 ms.  This is a polled timer tick rather than an interrupt: Tmr0 free-runs with an appropriate prescale value.  I use the Tmr0 Interrupt Flag as my indicator of overflow even though the Tmr0 Interrupt is disabled.

The two methods I use most often are as follows:

1) an up-down counter that is configured not to wrap either under or over flow.  Count 0x00 is a disallowed state and never occurs during run time.  The bit width of the counter is tailored to match my desired debounce time.

The debounce itself occurs during the background task when the timer tick is updated.  The foreground task simply tests the counter value for either max or min value as required.  

2) a single byte where the input state is rotated into the byte.  The sample rate is some sub-multiple of my main timer tick.

As above, the sample occurs during the background task when the timer tick is updated.  Also as above, the foreground task simply tests the byte for either 0xFF or 0x00.

I'll use this technique when I'm running a very slow clock and where only 8 samples gives me an appropriate debounce time.

Both of these are ery, very quick and quite easy to implement.