Copy this layout and make sure that the rails above the torch are activated (bright red)
Copy this assortment of rails.
Break the rails above the block and replace with another block. Put a lever next to the powered rail.
Place a minecart down and to start the timer flick the lever.
The minecart will travel back and forth creating a redstone signal every time it hits the detector rail.
To be able to actually use this timer, make your output connect to the detector rail. Enjoy and I hope this was useful in some way!