Yeah Scakk's example is short and to the point. And it can be modified to add an on/off switch, along with a timer to it.