Code for controlling a timer and display.