designing a generic timer