title: How to execute a while-loop for exactly 60 seconds in C++?
body: <p>Does anyone know how can I run this loop for 60 seconds and then stop? Here is my code:</p>
  
  <pre><code>#include&lt;iostream.h&gt;
  #include&lt;conio.h&gt;
  int main()
  {
      clrscr();
      int a=1;
      int b;
      cout&lt;&lt;"3.";
      b=a*10%7;
      while(b!=0)
      {
          cout&lt;&lt;a/7;
          a=b*10;
          b=a%7;
      }
      getch();
      return 0;
  }
  </code></pre>