First off… as per the directions that you deleted when posting (you did read them first… correct? )… you must properly format all posted code for proper forum viewing…
Then do so we will point you in the right direction, but you need to do the thinking.
And without much more details we don’t understand why you want a timer that only works this way… since what you are trying to do matters to the type of timer you want to use and how you set it up…