Even worse than making the user guess when an operation will complete is lying to them about it.
Progress bars should only be used when a reasonable level of accuracy is possible. It’s never a good idea to have a progress bar that reaches 10 percent and suddenly jumps to the end (leading users to believe that the operation may have aborted in midstream), or even worse, to be pegged at 100 percent long before the operation actually completes.
If you can’t determine an accurate completion percentage, a good alternative to a progress bar is just some indication that something might take a long time; perhaps a text display along the lines of “Please wait while your data is processed—this may take a few minutes …”, or perhaps an animation that gives the illusion of activity while the lengthy operation progresses.
For the latter, a handy website at http://www.ajaxload.info/ generates GIF animations that you can tailor to match your theme.
jQuery in Action by Bear Bibeault; Yehuda Katz