Show a “Spinner” If the Task Will Take an Indeterminate Amount of Time
In this case, by indeterminate, I mean that your software isn’t sure (or has no way of knowing) how many things it must do: it just knows that it will know when it is done.
Showing an animated spinner gives a user less information than a progress bar, but it at least tells them that something is happening, and their task will be done when the spinner vanishes.
Figure 63.1: A spinner. Other styles of spinner are available
If something goes wrong, then make the spinner stop. Your user doesn’t know whether this is a “loop forever” GIF, so they’ll just carry on waiting when nothing is happening behind the scenes. Gmail shows “loading” and then, after some time, it shows “still loading”, which is a nice touch.
A spinner is also great for tasks that are very short, for example when a page reloads, or when fetching some updated...