0.1 seconds or less: the illusion of direct manipulation is maintained. “You feel like you directly made the thing happen”. There should be no loading indicators of any sort. Animation should be sparse and economical (at 60fps you have 6 frames to tell the whole story), or absent if possible (`duration: 0.3s` instantly destroys direct manipulation).
1 second or less: 2-way interaction with flow. “You feel like the computer made the thing happen”. There should be a loading indicator of the indeterminate activity-is-happening type (spinner, pulsing gray text skeleton, etc). A vague reassurance the computer is working on it is enough.
10 seconds or less: Loss of control. The computer has put you on hold, and you’re waiting for it to get back to you. There should be a progress bar, spinners won’t cut it. Users don’t like losing control - take this period seriously.
More than 10 seconds: Loss of user. Persist session data to localStorage so at least it’ll be there if they ever come back.