title: How do i stop a while loop after a certain time in C
body: <p>How do i stop a while loop after a certain time in C, i did it in c++ and i tried converting that to c (below) but it didnt work</p>
  
  <pre><code>#include &lt;time.h&gt;
  
  int main(void)
  {
      time_t endwait;
      time_t start;
  
      endwait = start + seconds ;
      while (start &lt; endwait)
      {
          /* Do stuff while waiting */
      }
  }
  </code></pre>