title: Wait before showing a loading spinner?
body: <p>I want to use loading spinners in my single-page web application, which are easy enough to do if you want to show a spinner as soon as the request is fired and hide it as soon as the request is finished.</p>
  
  <p>Since requests often only take a few hundred milliseconds or less to complete, I'd rather not show a spinner right away, but rather wait <em>X</em> milliseconds first so that, on those requests that take less than X milliseconds to complete, the spinner doesn't flash on the screen and disappear, which could be jarring, especially in times when multiple panels are loading data at once.</p>
  
  <p>My first instinct is to use setTimeout, but I'm having trouble figuring out how to cancel one of multiple timers.</p>
  
  <p>Would I have to create a Timer class so that I could stop and start different instances of a setTimeout-like object? Am I thinking about this from the wrong angle?</p>