timestamps as used on mainframes/unix etc are imho the simplest,easiest and most efficient way to measure time periods accurately. they work marvelously on pic micros too, i have tried to demonstrate their usage on this and the other forum many times. the amount of interest generated was approximately nil.
see this [read through to end]

https://support.melabs.com/forum/pic...ond-pass/page2

timestamps can take whatever form required to suit your needs and are infinitely adaptable