title: Shiny Loading Spinner displaying too frequently
body: <p>I have a loading spinner in shiny which is implemented similarly to t<a href="https://stackoverflow.com/questions/17325521/r-shiny-display-loading-message-while-function-is-running">his answer</a>: </p>
  
  <pre><code>conditionalPanel(condition="$('html').hasClass('shiny-busy')",
                   tags$div("Loading...",id="loadmessage")
  )
  
  
  
  runApp(list(
    ui = pageWithSidebar(
        headerPanel("Test"),
           sidebarPanel(
             tags$head(tags$style(type="text/css", "
               #loadmessage {
                 position: fixed;
                 top: 0px;
                 left: 0px;
                 width: 100%;
                 padding: 5px 0px 5px 0px;
                 text-align: center;
                 font-weight: bold;
                 font-size: 100%;
                 color: #000000;
                 background-color: #CCFF66;
                 z-index: 105;
               }
            ")),
             numericInput('n', 'Number of obs', 100),
             conditionalPanel(condition="$('html').hasClass('shiny-busy')",
                              tags$div("Loading...",id="loadmessage"))
           ),
           mainPanel(plotOutput('plot'))
    ),
    server = function(input, output) {
      output$plot &lt;- renderPlot({ Sys.sleep(2); hist(runif(input$n)) })
    }
  ))
  </code></pre>
  
  <p>The issue I'm having is that the loader comes up all the time, even when shiny is busy for just a fraction of a second. This leads to the app blinking in and out all the time. Is there a way to basically set a delay on the conditional panel so that the spinner only comes up after the page is busy for a second?</p>