One approach is to break long running scripts up into shorter
sections. Have an "iterator" function that process item [n] through
[n+100]. Have an instance variable flag that keeps track of "n".
run the iterator for the first group of iterations. then using
*callLater* call the iterator again.
Using calllater permits the UI to redraw between runnings of
the iterator. You will have to do this if youwanted to show a
progress bar during the long operation. It would never update
unless you stop execution of the process and restart with
Finally, consider moving intense computations to the server.