Cleaning up, use timing based on us/ms depending on needed resolution. This is to avoid overflowing on long intervals.