title: jQuery Set wait time before a function executes
body: <p>How can i set wait time for this function.</p>
  
  <pre><code>function UpdateMedicaitonHistory(data) {
       MedicaitonHistoryGrid();
  //set a wait time to finish MedicaitonHistoryGrid() like for 3 seconds
  // then execute the below code.
  if ($("#MedHistoryGridSec").is(":visible")) {
              alert("yes we have grid");
        }
  else{
       alert("No Grid");
      }
  }
  </code></pre>