title: How can I start ajax function seconds after the user finishes typing
body: <p>Good night I would like to know if it is possible in the code below to insert this function in ajax. I would like to only submit the search after 2 seconds of the user finishing typing, replacing the "onkeyup".</p>
  
  <p><strong>PS</strong>:This is for an Ajax Live Search.</p>
  
  <pre><code>function pesquisar(value) {
  $("#results").show();
  $.ajax({
      type:'post', 
      url:'/classes/searchfetch.php', 
      data: {s:value},    
      success: function (data){
          $("#results").html(data);
      },
  }); };
  </code></pre>
  
  <p>I would be very grateful if you could help me.</p>