Working program that simulate a clock.