title: Delay between key pressing in C#
body: <p>I've got a method, that searches some data in DataGridView on KeyPress event and then focuses a row where input string was found (if is found).</p>
  
  <pre><code>private string input;
      private void Find_Matches()
      {            
          if (input.Length == 0) return;
  
          for (int x = 0; x &lt; dataGridViewCustomers.Rows.Count; x++)
              for (int y = 0; y &lt; dataGridViewCustomers.Columns.Count; y++)
                  if (dataGridViewCustomers.Rows[x].Cells[y].Value.ToString().Contains(input))
                      dataGridViewCustomers.Rows[x].Selected = true;
  
       }
  
  private void dataGridViewCustomers_KeyPress(object sender, KeyPressEventArgs e)
      {            
          input += e.KeyChar.ToString();
          Find_Matches();
      }
  </code></pre>
  
  <p>How to count a delay between keys pressings and, if it is more than 1 second, clear the "input" string? It's necessary for uninterrupted searching.</p>
  
  <p>Thanks.</p>