Program uses 16 bit counter to achieve time with 200us resolution. Time in ms is stored in variable Time. When Timer overflows it is reseted.