Start or stop timer when activated or inactivated.