Timeline Javascript Counter

Hi there,
Does any one know how to make a counter that will say count upwards from 0 - 10 (of any number) based on the time line length?

Thanks