Hi, our incredible plans to create an autonomous mode has failed (once again

) and im thinking we will have to rely on timers again. Last year, we used EasyC, but this year we're using MPLab. We have the idea of having a timer based on the number of loops. We believe each loop is 26.2 ms, so can we take this number and loop it xx times and increasing a counter each loop until it reaches the specific time?
example, we want to move 5 seconds forward
5s = 5000ms = 190 loops.
static int timer = 0;
**move forward**;
if (timer <190)
timer = timer +1 ;
if (timer >=190)
**stop**;
Thanks!!