Auto shut down AC Power

retrolefty:
http://1.bp.blogspot.com/_f2TjoRrM27k/TD12YBkV2aI/AAAAAAAAAeQ/HZV8ehjlWk4/s1600/timer-switch.jpg

That would work, but I want microcontroller to determine what the timer delay is.