title: How to compare time in c#?
body: <pre><code>        for (int i = 0; i &lt;= 10; i++)
          {
              if (5 seconds have passed)
              {
                  do something;
              }
          }
  </code></pre>
  
  <hr>
  
  <p>How can I check if 5 seconds have passed? If 5 seconds have passed for example, it "does something" , then again if more 5 seconds have passed, it does the same thing again, and so on.</p>
  
  <p><strong>And important:</strong> If I should use date &amp; time to do it, it should not be a specific time, it should be automatic.</p>