Fix issues with timer test
The timer test would blindly wait for an expected interval each time. However, in a busy system that might wait more than expected, this extra wait time can accumulate. Fix the issue by monitoring how much time has actually elapsed and only wait to the next expected point. Also add a check to make sure that we have not waited too long (and adjust the error message to hopefully make it more clear that the system waited more than expected).