In a web application I am working on there are some actions which usually take a few seconds or longer, depending on typical variables (connection speed, PC speed, amount of data involved, host load, etc). For these we show a progress bar, or a loading spinner with a "please wait" message depending on specific context. (I'll call both "wait indicator" from here on out)
This works well... when the action actually takes more than a second. But if the action actually takes less than about 500ms, the effect of the wait indicator showing up and then disappearing immediately looks like a glitch.
I can think of at least two ways that might improve this situation:
- Create some means of predicting how long each action will take (track the first few request lengths and compare to an average, use known data sizes as a multiplier for that, etc.), and then use that to decide up front whether or not to show the wait indicator. Pros: probably better outcome. Cons: difficult to implement, and will sometimes be wrong (which will be really bad if it takes several seconds but didn't think it should show the wait indicator).
- Make the wait indicators always show for a minimum length of time -- even if they complete more quickly. Pros: would never look "glitchy". Cons: waste of the user's time, makes the software looks slower.
Is there research in this area that might point to a better practice? Are there particular sites that have a great solution to this? What is best practice?
Rather than waiting a certain time to show it, I have just tried fading in (using css transition) the wait indicator over 1 second and that has a very good feel to it. When the wait is actually only 100ms, you barely see the wait indicator begin to show up and then it's gone.