Not sure... two things:
1) whether to let calling function keeps track of progress, or the progress bar. In the latter case one would have to supply the number of iterations. I have a small preference for the former, e.g. when the number of total iterations changes during iterating - then it's easier if the calling function can just provide another value for progress.
2) my idea would be to show progress only /after/ a computation is done. why show progress before?