Millions of examples...do you really need another one?
Code examples with explanations, tutorials, application notes, videos.... if this is not more than enough.
The problem with your post is that there is no clear question.
We don't know what you have done so far.
We don't know where exacly you need help. We won't do internet search for you.
We wont read the datasheet for you and write its contents here.
So please show what you have done so far.
What you know, what you understand..and what you don't understand.
wich MCU ?
wich Timer 0,2,4,6 ? 8bits or Timer 1,3,5 ...16 bits
choose one MCU
Read datasheet wich show all registers and sometime example in asm
then just translate asm -> C
very easy because register names could be nearly the same ..
a too much easy way is to use the mikroelektronica tool
(C:\_MikroC\mikroC PRO for PIC\Tools\Timer Calculator\TimerCalculator.exe)
but will learn nothing !