Where has the delay gone?

Ok cheers, I think I understand what I need to do from the example above.

My next question is how do you mitigate overrunning the loop time?
For example if I split my code into 4 void functions that run in order, if I get to the time critical one and its just under the required loop time, then it will continue through the program. But if the other 3 functions take a period of time to run, perhaps 50% of the loop time, then by the time it returns back to the time critical function it may have overrun by nearly 50% of the loop time, and thus giving an inaccuracy.