title: How to pause a program for a few milliseconds?
body: <p>How to pause a program for a few milliseconds using C++ managed code?
  I tried Sleep() but it didn't work when I included the winbase.h file, I got lots of compile errors!</p>
  
  <pre><code>for(int i=0; i&lt;10; i++)
   {
     simpleOpenGlControl1-&gt;MakeCurrent();
    System::Threading::Thread::Sleep(100);
        theta_rotated += 2.0* 3.141592653/(double)Model-&gt;size()/10.0;
  
    simpleOpenGlControl1-&gt;Invalidate();
   }
  
  private: System::Void simpleOpenGlControl1_Paint(System::Object^  sender, System::Windows::Forms::PaintEventArgs^  e) 
           {
  
               Gl::glMatrixMode(Gl::GL_MODELVIEW);
               Gl::glLoadIdentity();
               Gl::glClearColor(1, 1, 1, 1);
               Gl::glClear(Gl::GL_COLOR_BUFFER_BIT | Gl::GL_DEPTH_BUFFER_BIT);
               camera-&gt;Tellgl();
               Gl::glRotated(Angle,X,Y,Z);
               RenderModels();
           }
  void RenderModels(void)
  {
      Points = gcnew System::Collections::Generic::List&lt;Point&gt;();
      Point p(0,0) ;
      int t = -5;
      double r = 5;
      double x, z, theta;
      for(int i = 0;i &lt; Model-&gt;size();i++)
      {
          theta = i*2* 3.141592653/ (double)Model-&gt;size();
          x = r*sin(theta + theta_rotated);
          z = r*cos(theta + theta_rotated);
           Gl::glPushMatrix();
           Gl::glTranslated(x,0,z);
           Model-&gt;at(i).Render();
           p.X=x;
           p.Y=0;
  
           Points-&gt;Add(p);
           t +=1;
           Gl::glPopMatrix();
      }
      //simpleOpenGlControl1-&gt;Invalidate();
  }
  </code></pre>