Best option: Don't have a progress bar. The processing that could have gone into measuring and updating your progress can instead go to finishing the task a little quicker (Yes I know it would only amount to a fraction of a second, but time is money dammit!). Leave the user completely in the dark, and they'll think their system has frozen until they're pleasantly surprised when it finishes. People who get impatient and restart things, who think they know better than the programmer, don't deserve to use the software.