No Time To Code,
Without seeing your code, all we can do is speculate. But the pause is mostly likely going to be caused from the path finder chugging away. The more paths, the bigger the chunk of the time.
Now assuming finding a path is the bottle neck, then what you'll need to do is interleave this process across various frames. So the process is allotted a max amount time it can eat up per frame. If the routine exceeds this time, it saves it's current state and exits. Then next frame we re-run this job, reseting it to it's last state. So the routine should continue on from where it left off.
To do this generally means breaking the process in question down into a set of smaller tasks. This is going to be different for every routine obviously. So rather than checking if it's run over time , inside the inner loops, we're checking from some control routine. It'll still be possible for it to overshoot it's allocated time, however it they should never eat all the time. So we're adding a bit of fat to the routine, but gaining the ability to
thread it's execution.
I tend to use this type of approach whenever I need my program to appear to keep running while performing various tasks of an unknown length. One that comes to mind is the assembler in the Kyruss tech demo..
Kyruss