share common implementation for clocks

the conversion from ticks to microseconds is made generic.
move from microseconds to ticks internally