Implemented the core functions of the timer.